1#![doc = "MAVLink AVSSUAS dialect."]
2#![doc = ""]
3#![doc = "This file was automatically generated, do not edit."]
4#![allow(deprecated)]
5#[cfg(feature = "arbitrary")]
6use arbitrary::Arbitrary;
7#[allow(unused_imports)]
8use bitflags::bitflags;
9use mavlink_core::{bytes::Bytes, bytes_mut::BytesMut, MavlinkVersion, Message, MessageData};
10#[allow(unused_imports)]
11use num_derive::FromPrimitive;
12#[allow(unused_imports)]
13use num_derive::ToPrimitive;
14#[allow(unused_imports)]
15use num_traits::FromPrimitive;
16#[allow(unused_imports)]
17use num_traits::ToPrimitive;
18#[cfg(feature = "serde")]
19use serde::{Deserialize, Serialize};
20pub const MINOR_MAVLINK_VERSION: u8 = 2u8;
21pub const DIALECT_NUMBER: u8 = 1u8;
22#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
23#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
24#[cfg_attr(feature = "serde", serde(tag = "type"))]
25#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
26#[repr(u32)]
27#[doc = "Actuator configuration, used to change a setting on an actuator. Component information metadata can be used to know which outputs support which commands."]
28pub enum ActuatorConfiguration {
29 #[doc = "Do nothing."]
30 ACTUATOR_CONFIGURATION_NONE = 0,
31 #[doc = "Command the actuator to beep now."]
32 ACTUATOR_CONFIGURATION_BEEP = 1,
33 #[doc = "Permanently set the actuator (ESC) to 3D mode (reversible thrust)."]
34 ACTUATOR_CONFIGURATION_3D_MODE_ON = 2,
35 #[doc = "Permanently set the actuator (ESC) to non 3D mode (non-reversible thrust)."]
36 ACTUATOR_CONFIGURATION_3D_MODE_OFF = 3,
37 #[doc = "Permanently set the actuator (ESC) to spin direction 1 (which can be clockwise or counter-clockwise)."]
38 ACTUATOR_CONFIGURATION_SPIN_DIRECTION1 = 4,
39 #[doc = "Permanently set the actuator (ESC) to spin direction 2 (opposite of direction 1)."]
40 ACTUATOR_CONFIGURATION_SPIN_DIRECTION2 = 5,
41}
42impl ActuatorConfiguration {
43 pub const DEFAULT: Self = Self::ACTUATOR_CONFIGURATION_NONE;
44}
45impl Default for ActuatorConfiguration {
46 fn default() -> Self {
47 Self::DEFAULT
48 }
49}
50#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
51#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
52#[cfg_attr(feature = "serde", serde(tag = "type"))]
53#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
54#[repr(u32)]
55#[doc = "Actuator output function. Values greater or equal to 1000 are autopilot-specific."]
56pub enum ActuatorOutputFunction {
57 #[doc = "No function (disabled)."]
58 ACTUATOR_OUTPUT_FUNCTION_NONE = 0,
59 #[doc = "Motor 1"]
60 ACTUATOR_OUTPUT_FUNCTION_MOTOR1 = 1,
61 #[doc = "Motor 2"]
62 ACTUATOR_OUTPUT_FUNCTION_MOTOR2 = 2,
63 #[doc = "Motor 3"]
64 ACTUATOR_OUTPUT_FUNCTION_MOTOR3 = 3,
65 #[doc = "Motor 4"]
66 ACTUATOR_OUTPUT_FUNCTION_MOTOR4 = 4,
67 #[doc = "Motor 5"]
68 ACTUATOR_OUTPUT_FUNCTION_MOTOR5 = 5,
69 #[doc = "Motor 6"]
70 ACTUATOR_OUTPUT_FUNCTION_MOTOR6 = 6,
71 #[doc = "Motor 7"]
72 ACTUATOR_OUTPUT_FUNCTION_MOTOR7 = 7,
73 #[doc = "Motor 8"]
74 ACTUATOR_OUTPUT_FUNCTION_MOTOR8 = 8,
75 #[doc = "Motor 9"]
76 ACTUATOR_OUTPUT_FUNCTION_MOTOR9 = 9,
77 #[doc = "Motor 10"]
78 ACTUATOR_OUTPUT_FUNCTION_MOTOR10 = 10,
79 #[doc = "Motor 11"]
80 ACTUATOR_OUTPUT_FUNCTION_MOTOR11 = 11,
81 #[doc = "Motor 12"]
82 ACTUATOR_OUTPUT_FUNCTION_MOTOR12 = 12,
83 #[doc = "Motor 13"]
84 ACTUATOR_OUTPUT_FUNCTION_MOTOR13 = 13,
85 #[doc = "Motor 14"]
86 ACTUATOR_OUTPUT_FUNCTION_MOTOR14 = 14,
87 #[doc = "Motor 15"]
88 ACTUATOR_OUTPUT_FUNCTION_MOTOR15 = 15,
89 #[doc = "Motor 16"]
90 ACTUATOR_OUTPUT_FUNCTION_MOTOR16 = 16,
91 #[doc = "Servo 1"]
92 ACTUATOR_OUTPUT_FUNCTION_SERVO1 = 33,
93 #[doc = "Servo 2"]
94 ACTUATOR_OUTPUT_FUNCTION_SERVO2 = 34,
95 #[doc = "Servo 3"]
96 ACTUATOR_OUTPUT_FUNCTION_SERVO3 = 35,
97 #[doc = "Servo 4"]
98 ACTUATOR_OUTPUT_FUNCTION_SERVO4 = 36,
99 #[doc = "Servo 5"]
100 ACTUATOR_OUTPUT_FUNCTION_SERVO5 = 37,
101 #[doc = "Servo 6"]
102 ACTUATOR_OUTPUT_FUNCTION_SERVO6 = 38,
103 #[doc = "Servo 7"]
104 ACTUATOR_OUTPUT_FUNCTION_SERVO7 = 39,
105 #[doc = "Servo 8"]
106 ACTUATOR_OUTPUT_FUNCTION_SERVO8 = 40,
107 #[doc = "Servo 9"]
108 ACTUATOR_OUTPUT_FUNCTION_SERVO9 = 41,
109 #[doc = "Servo 10"]
110 ACTUATOR_OUTPUT_FUNCTION_SERVO10 = 42,
111 #[doc = "Servo 11"]
112 ACTUATOR_OUTPUT_FUNCTION_SERVO11 = 43,
113 #[doc = "Servo 12"]
114 ACTUATOR_OUTPUT_FUNCTION_SERVO12 = 44,
115 #[doc = "Servo 13"]
116 ACTUATOR_OUTPUT_FUNCTION_SERVO13 = 45,
117 #[doc = "Servo 14"]
118 ACTUATOR_OUTPUT_FUNCTION_SERVO14 = 46,
119 #[doc = "Servo 15"]
120 ACTUATOR_OUTPUT_FUNCTION_SERVO15 = 47,
121 #[doc = "Servo 16"]
122 ACTUATOR_OUTPUT_FUNCTION_SERVO16 = 48,
123}
124impl ActuatorOutputFunction {
125 pub const DEFAULT: Self = Self::ACTUATOR_OUTPUT_FUNCTION_NONE;
126}
127impl Default for ActuatorOutputFunction {
128 fn default() -> Self {
129 Self::DEFAULT
130 }
131}
132#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
133#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
134#[cfg_attr(feature = "serde", serde(tag = "type"))]
135#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
136#[repr(u32)]
137#[doc = "Enumeration of the ADSB altimeter types"]
138pub enum AdsbAltitudeType {
139 #[doc = "Altitude reported from a Baro source using QNH reference"]
140 ADSB_ALTITUDE_TYPE_PRESSURE_QNH = 0,
141 #[doc = "Altitude reported from a GNSS source"]
142 ADSB_ALTITUDE_TYPE_GEOMETRIC = 1,
143}
144impl AdsbAltitudeType {
145 pub const DEFAULT: Self = Self::ADSB_ALTITUDE_TYPE_PRESSURE_QNH;
146}
147impl Default for AdsbAltitudeType {
148 fn default() -> Self {
149 Self::DEFAULT
150 }
151}
152#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
153#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
154#[cfg_attr(feature = "serde", serde(tag = "type"))]
155#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
156#[repr(u32)]
157#[doc = "ADSB classification for the type of vehicle emitting the transponder signal"]
158pub enum AdsbEmitterType {
159 ADSB_EMITTER_TYPE_NO_INFO = 0,
160 ADSB_EMITTER_TYPE_LIGHT = 1,
161 ADSB_EMITTER_TYPE_SMALL = 2,
162 ADSB_EMITTER_TYPE_LARGE = 3,
163 ADSB_EMITTER_TYPE_HIGH_VORTEX_LARGE = 4,
164 ADSB_EMITTER_TYPE_HEAVY = 5,
165 ADSB_EMITTER_TYPE_HIGHLY_MANUV = 6,
166 ADSB_EMITTER_TYPE_ROTOCRAFT = 7,
167 ADSB_EMITTER_TYPE_UNASSIGNED = 8,
168 ADSB_EMITTER_TYPE_GLIDER = 9,
169 ADSB_EMITTER_TYPE_LIGHTER_AIR = 10,
170 ADSB_EMITTER_TYPE_PARACHUTE = 11,
171 ADSB_EMITTER_TYPE_ULTRA_LIGHT = 12,
172 ADSB_EMITTER_TYPE_UNASSIGNED2 = 13,
173 ADSB_EMITTER_TYPE_UAV = 14,
174 ADSB_EMITTER_TYPE_SPACE = 15,
175 ADSB_EMITTER_TYPE_UNASSGINED3 = 16,
176 ADSB_EMITTER_TYPE_EMERGENCY_SURFACE = 17,
177 ADSB_EMITTER_TYPE_SERVICE_SURFACE = 18,
178 ADSB_EMITTER_TYPE_POINT_OBSTACLE = 19,
179}
180impl AdsbEmitterType {
181 pub const DEFAULT: Self = Self::ADSB_EMITTER_TYPE_NO_INFO;
182}
183impl Default for AdsbEmitterType {
184 fn default() -> Self {
185 Self::DEFAULT
186 }
187}
188bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "These flags indicate status such as data validity of each data source. Set = data valid"] pub struct AdsbFlags : u16 { const ADSB_FLAGS_VALID_COORDS = 1 ; const ADSB_FLAGS_VALID_ALTITUDE = 2 ; const ADSB_FLAGS_VALID_HEADING = 4 ; const ADSB_FLAGS_VALID_VELOCITY = 8 ; const ADSB_FLAGS_VALID_CALLSIGN = 16 ; const ADSB_FLAGS_VALID_SQUAWK = 32 ; const ADSB_FLAGS_SIMULATED = 64 ; const ADSB_FLAGS_VERTICAL_VELOCITY_VALID = 128 ; const ADSB_FLAGS_BARO_VALID = 256 ; const ADSB_FLAGS_SOURCE_UAT = 32768 ; } }
189impl AdsbFlags {
190 pub const DEFAULT: Self = Self::ADSB_FLAGS_VALID_COORDS;
191}
192impl Default for AdsbFlags {
193 fn default() -> Self {
194 Self::DEFAULT
195 }
196}
197bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "These flags are used in the AIS_VESSEL.fields bitmask to indicate validity of data in the other message fields. When set, the data is valid."] pub struct AisFlags : u16 { # [doc = "1 = Position accuracy less than 10m, 0 = position accuracy greater than 10m."] const AIS_FLAGS_POSITION_ACCURACY = 1 ; const AIS_FLAGS_VALID_COG = 2 ; const AIS_FLAGS_VALID_VELOCITY = 4 ; # [doc = "1 = Velocity over 52.5765m/s (102.2 knots)"] const AIS_FLAGS_HIGH_VELOCITY = 8 ; const AIS_FLAGS_VALID_TURN_RATE = 16 ; # [doc = "Only the sign of the returned turn rate value is valid, either greater than 5deg/30s or less than -5deg/30s"] const AIS_FLAGS_TURN_RATE_SIGN_ONLY = 32 ; const AIS_FLAGS_VALID_DIMENSIONS = 64 ; # [doc = "Distance to bow is larger than 511m"] const AIS_FLAGS_LARGE_BOW_DIMENSION = 128 ; # [doc = "Distance to stern is larger than 511m"] const AIS_FLAGS_LARGE_STERN_DIMENSION = 256 ; # [doc = "Distance to port side is larger than 63m"] const AIS_FLAGS_LARGE_PORT_DIMENSION = 512 ; # [doc = "Distance to starboard side is larger than 63m"] const AIS_FLAGS_LARGE_STARBOARD_DIMENSION = 1024 ; const AIS_FLAGS_VALID_CALLSIGN = 2048 ; const AIS_FLAGS_VALID_NAME = 4096 ; } }
198impl AisFlags {
199 pub const DEFAULT: Self = Self::AIS_FLAGS_POSITION_ACCURACY;
200}
201impl Default for AisFlags {
202 fn default() -> Self {
203 Self::DEFAULT
204 }
205}
206#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
207#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
208#[cfg_attr(feature = "serde", serde(tag = "type"))]
209#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
210#[repr(u32)]
211#[doc = "Navigational status of AIS vessel, enum duplicated from AIS standard, <https://gpsd.gitlab.io/gpsd/AIVDM.html>"]
212pub enum AisNavStatus {
213 #[doc = "Under way using engine."]
214 UNDER_WAY = 0,
215 AIS_NAV_ANCHORED = 1,
216 AIS_NAV_UN_COMMANDED = 2,
217 AIS_NAV_RESTRICTED_MANOEUVERABILITY = 3,
218 AIS_NAV_DRAUGHT_CONSTRAINED = 4,
219 AIS_NAV_MOORED = 5,
220 AIS_NAV_AGROUND = 6,
221 AIS_NAV_FISHING = 7,
222 AIS_NAV_SAILING = 8,
223 AIS_NAV_RESERVED_HSC = 9,
224 AIS_NAV_RESERVED_WIG = 10,
225 AIS_NAV_RESERVED_1 = 11,
226 AIS_NAV_RESERVED_2 = 12,
227 AIS_NAV_RESERVED_3 = 13,
228 #[doc = "Search And Rescue Transponder."]
229 AIS_NAV_AIS_SART = 14,
230 #[doc = "Not available (default)."]
231 AIS_NAV_UNKNOWN = 15,
232}
233impl AisNavStatus {
234 pub const DEFAULT: Self = Self::UNDER_WAY;
235}
236impl Default for AisNavStatus {
237 fn default() -> Self {
238 Self::DEFAULT
239 }
240}
241#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
242#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
243#[cfg_attr(feature = "serde", serde(tag = "type"))]
244#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
245#[repr(u32)]
246#[doc = "Type of AIS vessel, enum duplicated from AIS standard, <https://gpsd.gitlab.io/gpsd/AIVDM.html>"]
247pub enum AisType {
248 #[doc = "Not available (default)."]
249 AIS_TYPE_UNKNOWN = 0,
250 AIS_TYPE_RESERVED_1 = 1,
251 AIS_TYPE_RESERVED_2 = 2,
252 AIS_TYPE_RESERVED_3 = 3,
253 AIS_TYPE_RESERVED_4 = 4,
254 AIS_TYPE_RESERVED_5 = 5,
255 AIS_TYPE_RESERVED_6 = 6,
256 AIS_TYPE_RESERVED_7 = 7,
257 AIS_TYPE_RESERVED_8 = 8,
258 AIS_TYPE_RESERVED_9 = 9,
259 AIS_TYPE_RESERVED_10 = 10,
260 AIS_TYPE_RESERVED_11 = 11,
261 AIS_TYPE_RESERVED_12 = 12,
262 AIS_TYPE_RESERVED_13 = 13,
263 AIS_TYPE_RESERVED_14 = 14,
264 AIS_TYPE_RESERVED_15 = 15,
265 AIS_TYPE_RESERVED_16 = 16,
266 AIS_TYPE_RESERVED_17 = 17,
267 AIS_TYPE_RESERVED_18 = 18,
268 AIS_TYPE_RESERVED_19 = 19,
269 #[doc = "Wing In Ground effect."]
270 AIS_TYPE_WIG = 20,
271 AIS_TYPE_WIG_HAZARDOUS_A = 21,
272 AIS_TYPE_WIG_HAZARDOUS_B = 22,
273 AIS_TYPE_WIG_HAZARDOUS_C = 23,
274 AIS_TYPE_WIG_HAZARDOUS_D = 24,
275 AIS_TYPE_WIG_RESERVED_1 = 25,
276 AIS_TYPE_WIG_RESERVED_2 = 26,
277 AIS_TYPE_WIG_RESERVED_3 = 27,
278 AIS_TYPE_WIG_RESERVED_4 = 28,
279 AIS_TYPE_WIG_RESERVED_5 = 29,
280 AIS_TYPE_FISHING = 30,
281 AIS_TYPE_TOWING = 31,
282 #[doc = "Towing: length exceeds 200m or breadth exceeds 25m."]
283 AIS_TYPE_TOWING_LARGE = 32,
284 #[doc = "Dredging or other underwater ops."]
285 AIS_TYPE_DREDGING = 33,
286 AIS_TYPE_DIVING = 34,
287 AIS_TYPE_MILITARY = 35,
288 AIS_TYPE_SAILING = 36,
289 AIS_TYPE_PLEASURE = 37,
290 AIS_TYPE_RESERVED_20 = 38,
291 AIS_TYPE_RESERVED_21 = 39,
292 #[doc = "High Speed Craft."]
293 AIS_TYPE_HSC = 40,
294 AIS_TYPE_HSC_HAZARDOUS_A = 41,
295 AIS_TYPE_HSC_HAZARDOUS_B = 42,
296 AIS_TYPE_HSC_HAZARDOUS_C = 43,
297 AIS_TYPE_HSC_HAZARDOUS_D = 44,
298 AIS_TYPE_HSC_RESERVED_1 = 45,
299 AIS_TYPE_HSC_RESERVED_2 = 46,
300 AIS_TYPE_HSC_RESERVED_3 = 47,
301 AIS_TYPE_HSC_RESERVED_4 = 48,
302 AIS_TYPE_HSC_UNKNOWN = 49,
303 AIS_TYPE_PILOT = 50,
304 #[doc = "Search And Rescue vessel."]
305 AIS_TYPE_SAR = 51,
306 AIS_TYPE_TUG = 52,
307 AIS_TYPE_PORT_TENDER = 53,
308 #[doc = "Anti-pollution equipment."]
309 AIS_TYPE_ANTI_POLLUTION = 54,
310 AIS_TYPE_LAW_ENFORCEMENT = 55,
311 AIS_TYPE_SPARE_LOCAL_1 = 56,
312 AIS_TYPE_SPARE_LOCAL_2 = 57,
313 AIS_TYPE_MEDICAL_TRANSPORT = 58,
314 #[doc = "Noncombatant ship according to RR Resolution No. 18."]
315 AIS_TYPE_NONECOMBATANT = 59,
316 AIS_TYPE_PASSENGER = 60,
317 AIS_TYPE_PASSENGER_HAZARDOUS_A = 61,
318 AIS_TYPE_PASSENGER_HAZARDOUS_B = 62,
319 AIS_TYPE_PASSENGER_HAZARDOUS_C = 63,
320 AIS_TYPE_PASSENGER_HAZARDOUS_D = 64,
321 AIS_TYPE_PASSENGER_RESERVED_1 = 65,
322 AIS_TYPE_PASSENGER_RESERVED_2 = 66,
323 AIS_TYPE_PASSENGER_RESERVED_3 = 67,
324 AIS_TYPE_PASSENGER_RESERVED_4 = 68,
325 AIS_TYPE_PASSENGER_UNKNOWN = 69,
326 AIS_TYPE_CARGO = 70,
327 AIS_TYPE_CARGO_HAZARDOUS_A = 71,
328 AIS_TYPE_CARGO_HAZARDOUS_B = 72,
329 AIS_TYPE_CARGO_HAZARDOUS_C = 73,
330 AIS_TYPE_CARGO_HAZARDOUS_D = 74,
331 AIS_TYPE_CARGO_RESERVED_1 = 75,
332 AIS_TYPE_CARGO_RESERVED_2 = 76,
333 AIS_TYPE_CARGO_RESERVED_3 = 77,
334 AIS_TYPE_CARGO_RESERVED_4 = 78,
335 AIS_TYPE_CARGO_UNKNOWN = 79,
336 AIS_TYPE_TANKER = 80,
337 AIS_TYPE_TANKER_HAZARDOUS_A = 81,
338 AIS_TYPE_TANKER_HAZARDOUS_B = 82,
339 AIS_TYPE_TANKER_HAZARDOUS_C = 83,
340 AIS_TYPE_TANKER_HAZARDOUS_D = 84,
341 AIS_TYPE_TANKER_RESERVED_1 = 85,
342 AIS_TYPE_TANKER_RESERVED_2 = 86,
343 AIS_TYPE_TANKER_RESERVED_3 = 87,
344 AIS_TYPE_TANKER_RESERVED_4 = 88,
345 AIS_TYPE_TANKER_UNKNOWN = 89,
346 AIS_TYPE_OTHER = 90,
347 AIS_TYPE_OTHER_HAZARDOUS_A = 91,
348 AIS_TYPE_OTHER_HAZARDOUS_B = 92,
349 AIS_TYPE_OTHER_HAZARDOUS_C = 93,
350 AIS_TYPE_OTHER_HAZARDOUS_D = 94,
351 AIS_TYPE_OTHER_RESERVED_1 = 95,
352 AIS_TYPE_OTHER_RESERVED_2 = 96,
353 AIS_TYPE_OTHER_RESERVED_3 = 97,
354 AIS_TYPE_OTHER_RESERVED_4 = 98,
355 AIS_TYPE_OTHER_UNKNOWN = 99,
356}
357impl AisType {
358 pub const DEFAULT: Self = Self::AIS_TYPE_UNKNOWN;
359}
360impl Default for AisType {
361 fn default() -> Self {
362 Self::DEFAULT
363 }
364}
365bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Bitmap to indicate which dimensions should be ignored by the vehicle: a value of 0b00000000 indicates that none of the setpoint dimensions should be ignored."] pub struct AttitudeTargetTypemask : u8 { # [doc = "Ignore body roll rate"] const ATTITUDE_TARGET_TYPEMASK_BODY_ROLL_RATE_IGNORE = 1 ; # [doc = "Ignore body pitch rate"] const ATTITUDE_TARGET_TYPEMASK_BODY_PITCH_RATE_IGNORE = 2 ; # [doc = "Ignore body yaw rate"] const ATTITUDE_TARGET_TYPEMASK_BODY_YAW_RATE_IGNORE = 4 ; # [doc = "Use 3D body thrust setpoint instead of throttle"] const ATTITUDE_TARGET_TYPEMASK_THRUST_BODY_SET = 32 ; # [doc = "Ignore throttle"] const ATTITUDE_TARGET_TYPEMASK_THROTTLE_IGNORE = 64 ; # [doc = "Ignore attitude"] const ATTITUDE_TARGET_TYPEMASK_ATTITUDE_IGNORE = 128 ; } }
366impl AttitudeTargetTypemask {
367 pub const DEFAULT: Self = Self::ATTITUDE_TARGET_TYPEMASK_BODY_ROLL_RATE_IGNORE;
368}
369impl Default for AttitudeTargetTypemask {
370 fn default() -> Self {
371 Self::DEFAULT
372 }
373}
374#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
375#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
376#[cfg_attr(feature = "serde", serde(tag = "type"))]
377#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
378#[repr(u32)]
379#[doc = "Axes that will be autotuned by MAV_CMD_DO_AUTOTUNE_ENABLE. Note that at least one flag must be set in MAV_CMD_DO_AUTOTUNE_ENABLE.param2: if none are set, the flight stack will tune its default set of axes."]
380pub enum AutotuneAxis {
381 #[doc = "Autotune roll axis."]
382 AUTOTUNE_AXIS_ROLL = 1,
383 #[doc = "Autotune pitch axis."]
384 AUTOTUNE_AXIS_PITCH = 2,
385 #[doc = "Autotune yaw axis."]
386 AUTOTUNE_AXIS_YAW = 4,
387}
388impl AutotuneAxis {
389 pub const DEFAULT: Self = Self::AUTOTUNE_AXIS_ROLL;
390}
391impl Default for AutotuneAxis {
392 fn default() -> Self {
393 Self::DEFAULT
394 }
395}
396#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
397#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
398#[cfg_attr(feature = "serde", serde(tag = "type"))]
399#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
400#[repr(u32)]
401pub enum AvssHorseflyOperationMode {
402 #[doc = "In manual control mode"]
403 MODE_HORSEFLY_MANUAL_CTRL = 0,
404 #[doc = "In auto takeoff mode"]
405 MODE_HORSEFLY_AUTO_TAKEOFF = 1,
406 #[doc = "In auto landing mode"]
407 MODE_HORSEFLY_AUTO_LANDING = 2,
408 #[doc = "In go home mode"]
409 MODE_HORSEFLY_NAVI_GO_HOME = 3,
410 #[doc = "In drop mode"]
411 MODE_HORSEFLY_DROP = 4,
412}
413impl AvssHorseflyOperationMode {
414 pub const DEFAULT: Self = Self::MODE_HORSEFLY_MANUAL_CTRL;
415}
416impl Default for AvssHorseflyOperationMode {
417 fn default() -> Self {
418 Self::DEFAULT
419 }
420}
421#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
422#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
423#[cfg_attr(feature = "serde", serde(tag = "type"))]
424#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
425#[repr(u32)]
426pub enum AvssM300OperationMode {
427 #[doc = "In manual control mode"]
428 MODE_M300_MANUAL_CTRL = 0,
429 #[doc = "In attitude mode"]
430 MODE_M300_ATTITUDE = 1,
431 #[doc = "In GPS mode"]
432 MODE_M300_P_GPS = 6,
433 #[doc = "In hotpoint mode"]
434 MODE_M300_HOTPOINT_MODE = 9,
435 #[doc = "In assisted takeoff mode"]
436 MODE_M300_ASSISTED_TAKEOFF = 10,
437 #[doc = "In auto takeoff mode"]
438 MODE_M300_AUTO_TAKEOFF = 11,
439 #[doc = "In auto landing mode"]
440 MODE_M300_AUTO_LANDING = 12,
441 #[doc = "In go home mode"]
442 MODE_M300_NAVI_GO_HOME = 15,
443 #[doc = "In sdk control mode"]
444 MODE_M300_NAVI_SDK_CTRL = 17,
445 #[doc = "In sport mode"]
446 MODE_M300_S_SPORT = 31,
447 #[doc = "In force auto landing mode"]
448 MODE_M300_FORCE_AUTO_LANDING = 33,
449 #[doc = "In tripod mode"]
450 MODE_M300_T_TRIPOD = 38,
451 #[doc = "In search mode"]
452 MODE_M300_SEARCH_MODE = 40,
453 #[doc = "In engine mode"]
454 MODE_M300_ENGINE_START = 41,
455}
456impl AvssM300OperationMode {
457 pub const DEFAULT: Self = Self::MODE_M300_MANUAL_CTRL;
458}
459impl Default for AvssM300OperationMode {
460 fn default() -> Self {
461 Self::DEFAULT
462 }
463}
464bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Camera capability flags (Bitmap)"] pub struct CameraCapFlags : u32 { # [doc = "Camera is able to record video"] const CAMERA_CAP_FLAGS_CAPTURE_VIDEO = 1 ; # [doc = "Camera is able to capture images"] const CAMERA_CAP_FLAGS_CAPTURE_IMAGE = 2 ; # [doc = "Camera has separate Video and Image/Photo modes (MAV_CMD_SET_CAMERA_MODE)"] const CAMERA_CAP_FLAGS_HAS_MODES = 4 ; # [doc = "Camera can capture images while in video mode"] const CAMERA_CAP_FLAGS_CAN_CAPTURE_IMAGE_IN_VIDEO_MODE = 8 ; # [doc = "Camera can capture videos while in Photo/Image mode"] const CAMERA_CAP_FLAGS_CAN_CAPTURE_VIDEO_IN_IMAGE_MODE = 16 ; # [doc = "Camera has image survey mode (MAV_CMD_SET_CAMERA_MODE)"] const CAMERA_CAP_FLAGS_HAS_IMAGE_SURVEY_MODE = 32 ; # [doc = "Camera has basic zoom control (MAV_CMD_SET_CAMERA_ZOOM)"] const CAMERA_CAP_FLAGS_HAS_BASIC_ZOOM = 64 ; # [doc = "Camera has basic focus control (MAV_CMD_SET_CAMERA_FOCUS)"] const CAMERA_CAP_FLAGS_HAS_BASIC_FOCUS = 128 ; # [doc = "Camera has video streaming capabilities (request VIDEO_STREAM_INFORMATION with MAV_CMD_REQUEST_MESSAGE for video streaming info)"] const CAMERA_CAP_FLAGS_HAS_VIDEO_STREAM = 256 ; # [doc = "Camera supports tracking of a point on the camera view."] const CAMERA_CAP_FLAGS_HAS_TRACKING_POINT = 512 ; # [doc = "Camera supports tracking of a selection rectangle on the camera view."] const CAMERA_CAP_FLAGS_HAS_TRACKING_RECTANGLE = 1024 ; # [doc = "Camera supports tracking geo status (CAMERA_TRACKING_GEO_STATUS)."] const CAMERA_CAP_FLAGS_HAS_TRACKING_GEO_STATUS = 2048 ; # [doc = "Camera supports absolute thermal range (request CAMERA_THERMAL_RANGE with MAV_CMD_REQUEST_MESSAGE)."] const CAMERA_CAP_FLAGS_HAS_THERMAL_RANGE = 4096 ; } }
465impl CameraCapFlags {
466 pub const DEFAULT: Self = Self::CAMERA_CAP_FLAGS_CAPTURE_VIDEO;
467}
468impl Default for CameraCapFlags {
469 fn default() -> Self {
470 Self::DEFAULT
471 }
472}
473#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
474#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
475#[cfg_attr(feature = "serde", serde(tag = "type"))]
476#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
477#[repr(u32)]
478#[doc = "Camera Modes."]
479pub enum CameraMode {
480 #[doc = "Camera is in image/photo capture mode."]
481 CAMERA_MODE_IMAGE = 0,
482 #[doc = "Camera is in video capture mode."]
483 CAMERA_MODE_VIDEO = 1,
484 #[doc = "Camera is in image survey capture mode. It allows for camera controller to do specific settings for surveys."]
485 CAMERA_MODE_IMAGE_SURVEY = 2,
486}
487impl CameraMode {
488 pub const DEFAULT: Self = Self::CAMERA_MODE_IMAGE;
489}
490impl Default for CameraMode {
491 fn default() -> Self {
492 Self::DEFAULT
493 }
494}
495#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
496#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
497#[cfg_attr(feature = "serde", serde(tag = "type"))]
498#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
499#[repr(u32)]
500#[doc = "Camera sources for MAV_CMD_SET_CAMERA_SOURCE"]
501pub enum CameraSource {
502 #[doc = "Default camera source."]
503 CAMERA_SOURCE_DEFAULT = 0,
504 #[doc = "RGB camera source."]
505 CAMERA_SOURCE_RGB = 1,
506 #[doc = "IR camera source."]
507 CAMERA_SOURCE_IR = 2,
508 #[doc = "NDVI camera source."]
509 CAMERA_SOURCE_NDVI = 3,
510}
511impl CameraSource {
512 pub const DEFAULT: Self = Self::CAMERA_SOURCE_DEFAULT;
513}
514impl Default for CameraSource {
515 fn default() -> Self {
516 Self::DEFAULT
517 }
518}
519#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
520#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
521#[cfg_attr(feature = "serde", serde(tag = "type"))]
522#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
523#[repr(u32)]
524#[doc = "Camera tracking modes"]
525pub enum CameraTrackingMode {
526 #[doc = "Not tracking"]
527 CAMERA_TRACKING_MODE_NONE = 0,
528 #[doc = "Target is a point"]
529 CAMERA_TRACKING_MODE_POINT = 1,
530 #[doc = "Target is a rectangle"]
531 CAMERA_TRACKING_MODE_RECTANGLE = 2,
532}
533impl CameraTrackingMode {
534 pub const DEFAULT: Self = Self::CAMERA_TRACKING_MODE_NONE;
535}
536impl Default for CameraTrackingMode {
537 fn default() -> Self {
538 Self::DEFAULT
539 }
540}
541#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
542#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
543#[cfg_attr(feature = "serde", serde(tag = "type"))]
544#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
545#[repr(u32)]
546#[doc = "Camera tracking status flags"]
547pub enum CameraTrackingStatusFlags {
548 #[doc = "Camera is not tracking"]
549 CAMERA_TRACKING_STATUS_FLAGS_IDLE = 0,
550 #[doc = "Camera is tracking"]
551 CAMERA_TRACKING_STATUS_FLAGS_ACTIVE = 1,
552 #[doc = "Camera tracking in error state"]
553 CAMERA_TRACKING_STATUS_FLAGS_ERROR = 2,
554}
555impl CameraTrackingStatusFlags {
556 pub const DEFAULT: Self = Self::CAMERA_TRACKING_STATUS_FLAGS_IDLE;
557}
558impl Default for CameraTrackingStatusFlags {
559 fn default() -> Self {
560 Self::DEFAULT
561 }
562}
563bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Camera tracking target data (shows where tracked target is within image)"] pub struct CameraTrackingTargetData : u8 { # [doc = "Target data embedded in image data (proprietary)"] const CAMERA_TRACKING_TARGET_DATA_EMBEDDED = 1 ; # [doc = "Target data rendered in image"] const CAMERA_TRACKING_TARGET_DATA_RENDERED = 2 ; # [doc = "Target data within status message (Point or Rectangle)"] const CAMERA_TRACKING_TARGET_DATA_IN_STATUS = 4 ; } }
564impl CameraTrackingTargetData {
565 pub const DEFAULT: Self = Self::CAMERA_TRACKING_TARGET_DATA_EMBEDDED;
566}
567impl Default for CameraTrackingTargetData {
568 fn default() -> Self {
569 Self::DEFAULT
570 }
571}
572#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
573#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
574#[cfg_attr(feature = "serde", serde(tag = "type"))]
575#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
576#[repr(u32)]
577#[doc = "Zoom types for MAV_CMD_SET_CAMERA_ZOOM"]
578pub enum CameraZoomType {
579 #[doc = "Zoom one step increment (-1 for wide, 1 for tele)"]
580 ZOOM_TYPE_STEP = 0,
581 #[doc = "Continuous normalized zoom in/out rate until stopped. Range -1..1, negative: wide, positive: narrow/tele, 0 to stop zooming. Other values should be clipped to the range."]
582 ZOOM_TYPE_CONTINUOUS = 1,
583 #[doc = "Zoom value as proportion of full camera range (a percentage value between 0.0 and 100.0)"]
584 ZOOM_TYPE_RANGE = 2,
585 #[doc = "Zoom value/variable focal length in millimetres. Note that there is no message to get the valid zoom range of the camera, so this can type can only be used for cameras where the zoom range is known (implying that this cannot reliably be used in a GCS for an arbitrary camera)"]
586 ZOOM_TYPE_FOCAL_LENGTH = 3,
587 #[doc = "Zoom value as horizontal field of view in degrees."]
588 ZOOM_TYPE_HORIZONTAL_FOV = 4,
589}
590impl CameraZoomType {
591 pub const DEFAULT: Self = Self::ZOOM_TYPE_STEP;
592}
593impl Default for CameraZoomType {
594 fn default() -> Self {
595 Self::DEFAULT
596 }
597}
598#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
599#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
600#[cfg_attr(feature = "serde", serde(tag = "type"))]
601#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
602#[repr(u32)]
603pub enum CanFilterOp {
604 CAN_FILTER_REPLACE = 0,
605 CAN_FILTER_ADD = 1,
606 CAN_FILTER_REMOVE = 2,
607}
608impl CanFilterOp {
609 pub const DEFAULT: Self = Self::CAN_FILTER_REPLACE;
610}
611impl Default for CanFilterOp {
612 fn default() -> Self {
613 Self::DEFAULT
614 }
615}
616#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
617#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
618#[cfg_attr(feature = "serde", serde(tag = "type"))]
619#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
620#[repr(u32)]
621#[doc = "Possible responses from a CELLULAR_CONFIG message."]
622pub enum CellularConfigResponse {
623 #[doc = "Changes accepted."]
624 CELLULAR_CONFIG_RESPONSE_ACCEPTED = 0,
625 #[doc = "Invalid APN."]
626 CELLULAR_CONFIG_RESPONSE_APN_ERROR = 1,
627 #[doc = "Invalid PIN."]
628 CELLULAR_CONFIG_RESPONSE_PIN_ERROR = 2,
629 #[doc = "Changes rejected."]
630 CELLULAR_CONFIG_RESPONSE_REJECTED = 3,
631 #[doc = "PUK is required to unblock SIM card."]
632 CELLULAR_CONFIG_BLOCKED_PUK_REQUIRED = 4,
633}
634impl CellularConfigResponse {
635 pub const DEFAULT: Self = Self::CELLULAR_CONFIG_RESPONSE_ACCEPTED;
636}
637impl Default for CellularConfigResponse {
638 fn default() -> Self {
639 Self::DEFAULT
640 }
641}
642#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
643#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
644#[cfg_attr(feature = "serde", serde(tag = "type"))]
645#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
646#[repr(u32)]
647#[doc = "These flags are used to diagnose the failure state of CELLULAR_STATUS"]
648pub enum CellularNetworkFailedReason {
649 #[doc = "No error"]
650 CELLULAR_NETWORK_FAILED_REASON_NONE = 0,
651 #[doc = "Error state is unknown"]
652 CELLULAR_NETWORK_FAILED_REASON_UNKNOWN = 1,
653 #[doc = "SIM is required for the modem but missing"]
654 CELLULAR_NETWORK_FAILED_REASON_SIM_MISSING = 2,
655 #[doc = "SIM is available, but not usable for connection"]
656 CELLULAR_NETWORK_FAILED_REASON_SIM_ERROR = 3,
657}
658impl CellularNetworkFailedReason {
659 pub const DEFAULT: Self = Self::CELLULAR_NETWORK_FAILED_REASON_NONE;
660}
661impl Default for CellularNetworkFailedReason {
662 fn default() -> Self {
663 Self::DEFAULT
664 }
665}
666#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
667#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
668#[cfg_attr(feature = "serde", serde(tag = "type"))]
669#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
670#[repr(u32)]
671#[doc = "Cellular network radio type"]
672pub enum CellularNetworkRadioType {
673 CELLULAR_NETWORK_RADIO_TYPE_NONE = 0,
674 CELLULAR_NETWORK_RADIO_TYPE_GSM = 1,
675 CELLULAR_NETWORK_RADIO_TYPE_CDMA = 2,
676 CELLULAR_NETWORK_RADIO_TYPE_WCDMA = 3,
677 CELLULAR_NETWORK_RADIO_TYPE_LTE = 4,
678}
679impl CellularNetworkRadioType {
680 pub const DEFAULT: Self = Self::CELLULAR_NETWORK_RADIO_TYPE_NONE;
681}
682impl Default for CellularNetworkRadioType {
683 fn default() -> Self {
684 Self::DEFAULT
685 }
686}
687#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
688#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
689#[cfg_attr(feature = "serde", serde(tag = "type"))]
690#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
691#[repr(u32)]
692#[doc = "These flags encode the cellular network status"]
693pub enum CellularStatusFlag {
694 #[doc = "State unknown or not reportable."]
695 CELLULAR_STATUS_FLAG_UNKNOWN = 0,
696 #[doc = "Modem is unusable"]
697 CELLULAR_STATUS_FLAG_FAILED = 1,
698 #[doc = "Modem is being initialized"]
699 CELLULAR_STATUS_FLAG_INITIALIZING = 2,
700 #[doc = "Modem is locked"]
701 CELLULAR_STATUS_FLAG_LOCKED = 3,
702 #[doc = "Modem is not enabled and is powered down"]
703 CELLULAR_STATUS_FLAG_DISABLED = 4,
704 #[doc = "Modem is currently transitioning to the CELLULAR_STATUS_FLAG_DISABLED state"]
705 CELLULAR_STATUS_FLAG_DISABLING = 5,
706 #[doc = "Modem is currently transitioning to the CELLULAR_STATUS_FLAG_ENABLED state"]
707 CELLULAR_STATUS_FLAG_ENABLING = 6,
708 #[doc = "Modem is enabled and powered on but not registered with a network provider and not available for data connections"]
709 CELLULAR_STATUS_FLAG_ENABLED = 7,
710 #[doc = "Modem is searching for a network provider to register"]
711 CELLULAR_STATUS_FLAG_SEARCHING = 8,
712 #[doc = "Modem is registered with a network provider, and data connections and messaging may be available for use"]
713 CELLULAR_STATUS_FLAG_REGISTERED = 9,
714 #[doc = "Modem is disconnecting and deactivating the last active packet data bearer. This state will not be entered if more than one packet data bearer is active and one of the active bearers is deactivated"]
715 CELLULAR_STATUS_FLAG_DISCONNECTING = 10,
716 #[doc = "Modem is activating and connecting the first packet data bearer. Subsequent bearer activations when another bearer is already active do not cause this state to be entered"]
717 CELLULAR_STATUS_FLAG_CONNECTING = 11,
718 #[doc = "One or more packet data bearers is active and connected"]
719 CELLULAR_STATUS_FLAG_CONNECTED = 12,
720}
721impl CellularStatusFlag {
722 pub const DEFAULT: Self = Self::CELLULAR_STATUS_FLAG_UNKNOWN;
723}
724impl Default for CellularStatusFlag {
725 fn default() -> Self {
726 Self::DEFAULT
727 }
728}
729#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
730#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
731#[cfg_attr(feature = "serde", serde(tag = "type"))]
732#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
733#[repr(u32)]
734#[doc = "Supported component metadata types. These are used in the \"general\" metadata file returned by COMPONENT_METADATA to provide information about supported metadata types. The types are not used directly in MAVLink messages."]
735pub enum CompMetadataType {
736 #[doc = "General information about the component. General metadata includes information about other metadata types supported by the component. Files of this type must be supported, and must be downloadable from vehicle using a MAVLink FTP URI."]
737 COMP_METADATA_TYPE_GENERAL = 0,
738 #[doc = "Parameter meta data."]
739 COMP_METADATA_TYPE_PARAMETER = 1,
740 #[doc = "Meta data that specifies which commands and command parameters the vehicle supports. (WIP)"]
741 COMP_METADATA_TYPE_COMMANDS = 2,
742 #[doc = "Meta data that specifies external non-MAVLink peripherals."]
743 COMP_METADATA_TYPE_PERIPHERALS = 3,
744 #[doc = "Meta data for the events interface."]
745 COMP_METADATA_TYPE_EVENTS = 4,
746 #[doc = "Meta data for actuator configuration (motors, servos and vehicle geometry) and testing."]
747 COMP_METADATA_TYPE_ACTUATORS = 5,
748}
749impl CompMetadataType {
750 pub const DEFAULT: Self = Self::COMP_METADATA_TYPE_GENERAL;
751}
752impl Default for CompMetadataType {
753 fn default() -> Self {
754 Self::DEFAULT
755 }
756}
757#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
758#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
759#[cfg_attr(feature = "serde", serde(tag = "type"))]
760#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
761#[repr(u32)]
762#[doc = "Indicates the ESC connection type."]
763pub enum EscConnectionType {
764 #[doc = "Traditional PPM ESC."]
765 ESC_CONNECTION_TYPE_PPM = 0,
766 #[doc = "Serial Bus connected ESC."]
767 ESC_CONNECTION_TYPE_SERIAL = 1,
768 #[doc = "One Shot PPM ESC."]
769 ESC_CONNECTION_TYPE_ONESHOT = 2,
770 #[doc = "I2C ESC."]
771 ESC_CONNECTION_TYPE_I2C = 3,
772 #[doc = "CAN-Bus ESC."]
773 ESC_CONNECTION_TYPE_CAN = 4,
774 #[doc = "DShot ESC."]
775 ESC_CONNECTION_TYPE_DSHOT = 5,
776}
777impl EscConnectionType {
778 pub const DEFAULT: Self = Self::ESC_CONNECTION_TYPE_PPM;
779}
780impl Default for EscConnectionType {
781 fn default() -> Self {
782 Self::DEFAULT
783 }
784}
785bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Flags to report ESC failures."] pub struct EscFailureFlags : u16 { # [doc = "Over current failure."] const ESC_FAILURE_OVER_CURRENT = 1 ; # [doc = "Over voltage failure."] const ESC_FAILURE_OVER_VOLTAGE = 2 ; # [doc = "Over temperature failure."] const ESC_FAILURE_OVER_TEMPERATURE = 4 ; # [doc = "Over RPM failure."] const ESC_FAILURE_OVER_RPM = 8 ; # [doc = "Inconsistent command failure i.e. out of bounds."] const ESC_FAILURE_INCONSISTENT_CMD = 16 ; # [doc = "Motor stuck failure."] const ESC_FAILURE_MOTOR_STUCK = 32 ; # [doc = "Generic ESC failure."] const ESC_FAILURE_GENERIC = 64 ; } }
786impl EscFailureFlags {
787 pub const DEFAULT: Self = Self::ESC_FAILURE_OVER_CURRENT;
788}
789impl Default for EscFailureFlags {
790 fn default() -> Self {
791 Self::DEFAULT
792 }
793}
794bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Flags in ESTIMATOR_STATUS message"] pub struct EstimatorStatusFlags : u16 { # [doc = "True if the attitude estimate is good"] const ESTIMATOR_ATTITUDE = 1 ; # [doc = "True if the horizontal velocity estimate is good"] const ESTIMATOR_VELOCITY_HORIZ = 2 ; # [doc = "True if the vertical velocity estimate is good"] const ESTIMATOR_VELOCITY_VERT = 4 ; # [doc = "True if the horizontal position (relative) estimate is good"] const ESTIMATOR_POS_HORIZ_REL = 8 ; # [doc = "True if the horizontal position (absolute) estimate is good"] const ESTIMATOR_POS_HORIZ_ABS = 16 ; # [doc = "True if the vertical position (absolute) estimate is good"] const ESTIMATOR_POS_VERT_ABS = 32 ; # [doc = "True if the vertical position (above ground) estimate is good"] const ESTIMATOR_POS_VERT_AGL = 64 ; # [doc = "True if the EKF is in a constant position mode and is not using external measurements (eg GPS or optical flow)"] const ESTIMATOR_CONST_POS_MODE = 128 ; # [doc = "True if the EKF has sufficient data to enter a mode that will provide a (relative) position estimate"] const ESTIMATOR_PRED_POS_HORIZ_REL = 256 ; # [doc = "True if the EKF has sufficient data to enter a mode that will provide a (absolute) position estimate"] const ESTIMATOR_PRED_POS_HORIZ_ABS = 512 ; # [doc = "True if the EKF has detected a GPS glitch"] const ESTIMATOR_GPS_GLITCH = 1024 ; # [doc = "True if the EKF has detected bad accelerometer data"] const ESTIMATOR_ACCEL_ERROR = 2048 ; } }
795impl EstimatorStatusFlags {
796 pub const DEFAULT: Self = Self::ESTIMATOR_ATTITUDE;
797}
798impl Default for EstimatorStatusFlags {
799 fn default() -> Self {
800 Self::DEFAULT
801 }
802}
803#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
804#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
805#[cfg_attr(feature = "serde", serde(tag = "type"))]
806#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
807#[repr(u32)]
808#[doc = "List of possible failure type to inject."]
809pub enum FailureType {
810 #[doc = "No failure injected, used to reset a previous failure."]
811 FAILURE_TYPE_OK = 0,
812 #[doc = "Sets unit off, so completely non-responsive."]
813 FAILURE_TYPE_OFF = 1,
814 #[doc = "Unit is stuck e.g. keeps reporting the same value."]
815 FAILURE_TYPE_STUCK = 2,
816 #[doc = "Unit is reporting complete garbage."]
817 FAILURE_TYPE_GARBAGE = 3,
818 #[doc = "Unit is consistently wrong."]
819 FAILURE_TYPE_WRONG = 4,
820 #[doc = "Unit is slow, so e.g. reporting at slower than expected rate."]
821 FAILURE_TYPE_SLOW = 5,
822 #[doc = "Data of unit is delayed in time."]
823 FAILURE_TYPE_DELAYED = 6,
824 #[doc = "Unit is sometimes working, sometimes not."]
825 FAILURE_TYPE_INTERMITTENT = 7,
826}
827impl FailureType {
828 pub const DEFAULT: Self = Self::FAILURE_TYPE_OK;
829}
830impl Default for FailureType {
831 fn default() -> Self {
832 Self::DEFAULT
833 }
834}
835#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
836#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
837#[cfg_attr(feature = "serde", serde(tag = "type"))]
838#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
839#[repr(u32)]
840#[doc = "List of possible units where failures can be injected."]
841pub enum FailureUnit {
842 FAILURE_UNIT_SENSOR_GYRO = 0,
843 FAILURE_UNIT_SENSOR_ACCEL = 1,
844 FAILURE_UNIT_SENSOR_MAG = 2,
845 FAILURE_UNIT_SENSOR_BARO = 3,
846 FAILURE_UNIT_SENSOR_GPS = 4,
847 FAILURE_UNIT_SENSOR_OPTICAL_FLOW = 5,
848 FAILURE_UNIT_SENSOR_VIO = 6,
849 FAILURE_UNIT_SENSOR_DISTANCE_SENSOR = 7,
850 FAILURE_UNIT_SENSOR_AIRSPEED = 8,
851 FAILURE_UNIT_SYSTEM_BATTERY = 100,
852 FAILURE_UNIT_SYSTEM_MOTOR = 101,
853 FAILURE_UNIT_SYSTEM_SERVO = 102,
854 FAILURE_UNIT_SYSTEM_AVOIDANCE = 103,
855 FAILURE_UNIT_SYSTEM_RC_SIGNAL = 104,
856 FAILURE_UNIT_SYSTEM_MAVLINK_SIGNAL = 105,
857}
858impl FailureUnit {
859 pub const DEFAULT: Self = Self::FAILURE_UNIT_SENSOR_GYRO;
860}
861impl Default for FailureUnit {
862 fn default() -> Self {
863 Self::DEFAULT
864 }
865}
866#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
867#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
868#[cfg_attr(feature = "serde", serde(tag = "type"))]
869#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
870#[repr(u32)]
871pub enum FenceBreach {
872 #[doc = "No last fence breach"]
873 FENCE_BREACH_NONE = 0,
874 #[doc = "Breached minimum altitude"]
875 FENCE_BREACH_MINALT = 1,
876 #[doc = "Breached maximum altitude"]
877 FENCE_BREACH_MAXALT = 2,
878 #[doc = "Breached fence boundary"]
879 FENCE_BREACH_BOUNDARY = 3,
880}
881impl FenceBreach {
882 pub const DEFAULT: Self = Self::FENCE_BREACH_NONE;
883}
884impl Default for FenceBreach {
885 fn default() -> Self {
886 Self::DEFAULT
887 }
888}
889#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
890#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
891#[cfg_attr(feature = "serde", serde(tag = "type"))]
892#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
893#[repr(u32)]
894#[doc = "Actions being taken to mitigate/prevent fence breach"]
895pub enum FenceMitigate {
896 #[doc = "Unknown"]
897 FENCE_MITIGATE_UNKNOWN = 0,
898 #[doc = "No actions being taken"]
899 FENCE_MITIGATE_NONE = 1,
900 #[doc = "Velocity limiting active to prevent breach"]
901 FENCE_MITIGATE_VEL_LIMIT = 2,
902}
903impl FenceMitigate {
904 pub const DEFAULT: Self = Self::FENCE_MITIGATE_UNKNOWN;
905}
906impl Default for FenceMitigate {
907 fn default() -> Self {
908 Self::DEFAULT
909 }
910}
911#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
912#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
913#[cfg_attr(feature = "serde", serde(tag = "type"))]
914#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
915#[repr(u32)]
916#[doc = "Fence types to enable or disable when using MAV_CMD_DO_FENCE_ENABLE. Note that at least one of these flags must be set in MAV_CMD_DO_FENCE_ENABLE.param2. If none are set, the flight stack will ignore the field and enable/disable its default set of fences (usually all of them)."]
917pub enum FenceType {
918 #[doc = "Maximum altitude fence"]
919 FENCE_TYPE_ALT_MAX = 1,
920 #[doc = "Circle fence"]
921 FENCE_TYPE_CIRCLE = 2,
922 #[doc = "Polygon fence"]
923 FENCE_TYPE_POLYGON = 4,
924 #[doc = "Minimum altitude fence"]
925 FENCE_TYPE_ALT_MIN = 8,
926}
927impl FenceType {
928 pub const DEFAULT: Self = Self::FENCE_TYPE_ALT_MAX;
929}
930impl Default for FenceType {
931 fn default() -> Self {
932 Self::DEFAULT
933 }
934}
935#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
936#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
937#[cfg_attr(feature = "serde", serde(tag = "type"))]
938#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
939#[repr(u32)]
940#[doc = "These values define the type of firmware release. These values indicate the first version or release of this type. For example the first alpha release would be 64, the second would be 65."]
941pub enum FirmwareVersionType {
942 #[doc = "development release"]
943 FIRMWARE_VERSION_TYPE_DEV = 0,
944 #[doc = "alpha release"]
945 FIRMWARE_VERSION_TYPE_ALPHA = 64,
946 #[doc = "beta release"]
947 FIRMWARE_VERSION_TYPE_BETA = 128,
948 #[doc = "release candidate"]
949 FIRMWARE_VERSION_TYPE_RC = 192,
950 #[doc = "official stable release"]
951 FIRMWARE_VERSION_TYPE_OFFICIAL = 255,
952}
953impl FirmwareVersionType {
954 pub const DEFAULT: Self = Self::FIRMWARE_VERSION_TYPE_DEV;
955}
956impl Default for FirmwareVersionType {
957 fn default() -> Self {
958 Self::DEFAULT
959 }
960}
961bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Gimbal device (low level) capability flags (bitmap)."] pub struct GimbalDeviceCapFlags : u16 { # [doc = "Gimbal device supports a retracted position."] const GIMBAL_DEVICE_CAP_FLAGS_HAS_RETRACT = 1 ; # [doc = "Gimbal device supports a horizontal, forward looking position, stabilized."] const GIMBAL_DEVICE_CAP_FLAGS_HAS_NEUTRAL = 2 ; # [doc = "Gimbal device supports rotating around roll axis."] const GIMBAL_DEVICE_CAP_FLAGS_HAS_ROLL_AXIS = 4 ; # [doc = "Gimbal device supports to follow a roll angle relative to the vehicle."] const GIMBAL_DEVICE_CAP_FLAGS_HAS_ROLL_FOLLOW = 8 ; # [doc = "Gimbal device supports locking to a roll angle (generally that's the default with roll stabilized)."] const GIMBAL_DEVICE_CAP_FLAGS_HAS_ROLL_LOCK = 16 ; # [doc = "Gimbal device supports rotating around pitch axis."] const GIMBAL_DEVICE_CAP_FLAGS_HAS_PITCH_AXIS = 32 ; # [doc = "Gimbal device supports to follow a pitch angle relative to the vehicle."] const GIMBAL_DEVICE_CAP_FLAGS_HAS_PITCH_FOLLOW = 64 ; # [doc = "Gimbal device supports locking to a pitch angle (generally that's the default with pitch stabilized)."] const GIMBAL_DEVICE_CAP_FLAGS_HAS_PITCH_LOCK = 128 ; # [doc = "Gimbal device supports rotating around yaw axis."] const GIMBAL_DEVICE_CAP_FLAGS_HAS_YAW_AXIS = 256 ; # [doc = "Gimbal device supports to follow a yaw angle relative to the vehicle (generally that's the default)."] const GIMBAL_DEVICE_CAP_FLAGS_HAS_YAW_FOLLOW = 512 ; # [doc = "Gimbal device supports locking to an absolute heading, i.e., yaw angle relative to North (earth frame, often this is an option available)."] const GIMBAL_DEVICE_CAP_FLAGS_HAS_YAW_LOCK = 1024 ; # [doc = "Gimbal device supports yawing/panning infinitely (e.g. using slip disk)."] const GIMBAL_DEVICE_CAP_FLAGS_SUPPORTS_INFINITE_YAW = 2048 ; # [doc = "Gimbal device supports yaw angles and angular velocities relative to North (earth frame). This usually requires support by an autopilot via AUTOPILOT_STATE_FOR_GIMBAL_DEVICE. Support can go on and off during runtime, which is reported by the flag GIMBAL_DEVICE_FLAGS_CAN_ACCEPT_YAW_IN_EARTH_FRAME."] const GIMBAL_DEVICE_CAP_FLAGS_SUPPORTS_YAW_IN_EARTH_FRAME = 4096 ; # [doc = "Gimbal device supports radio control inputs as an alternative input for controlling the gimbal orientation."] const GIMBAL_DEVICE_CAP_FLAGS_HAS_RC_INPUTS = 8192 ; } }
962impl GimbalDeviceCapFlags {
963 pub const DEFAULT: Self = Self::GIMBAL_DEVICE_CAP_FLAGS_HAS_RETRACT;
964}
965impl Default for GimbalDeviceCapFlags {
966 fn default() -> Self {
967 Self::DEFAULT
968 }
969}
970bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Gimbal device (low level) error flags (bitmap, 0 means no error)"] pub struct GimbalDeviceErrorFlags : u32 { # [doc = "Gimbal device is limited by hardware roll limit."] const GIMBAL_DEVICE_ERROR_FLAGS_AT_ROLL_LIMIT = 1 ; # [doc = "Gimbal device is limited by hardware pitch limit."] const GIMBAL_DEVICE_ERROR_FLAGS_AT_PITCH_LIMIT = 2 ; # [doc = "Gimbal device is limited by hardware yaw limit."] const GIMBAL_DEVICE_ERROR_FLAGS_AT_YAW_LIMIT = 4 ; # [doc = "There is an error with the gimbal encoders."] const GIMBAL_DEVICE_ERROR_FLAGS_ENCODER_ERROR = 8 ; # [doc = "There is an error with the gimbal power source."] const GIMBAL_DEVICE_ERROR_FLAGS_POWER_ERROR = 16 ; # [doc = "There is an error with the gimbal motors."] const GIMBAL_DEVICE_ERROR_FLAGS_MOTOR_ERROR = 32 ; # [doc = "There is an error with the gimbal's software."] const GIMBAL_DEVICE_ERROR_FLAGS_SOFTWARE_ERROR = 64 ; # [doc = "There is an error with the gimbal's communication."] const GIMBAL_DEVICE_ERROR_FLAGS_COMMS_ERROR = 128 ; # [doc = "Gimbal device is currently calibrating."] const GIMBAL_DEVICE_ERROR_FLAGS_CALIBRATION_RUNNING = 256 ; # [doc = "Gimbal device is not assigned to a gimbal manager."] const GIMBAL_DEVICE_ERROR_FLAGS_NO_MANAGER = 512 ; } }
971impl GimbalDeviceErrorFlags {
972 pub const DEFAULT: Self = Self::GIMBAL_DEVICE_ERROR_FLAGS_AT_ROLL_LIMIT;
973}
974impl Default for GimbalDeviceErrorFlags {
975 fn default() -> Self {
976 Self::DEFAULT
977 }
978}
979bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Flags for gimbal device (lower level) operation."] pub struct GimbalDeviceFlags : u16 { # [doc = "Set to retracted safe position (no stabilization), takes precedence over all other flags."] const GIMBAL_DEVICE_FLAGS_RETRACT = 1 ; # [doc = "Set to neutral/default position, taking precedence over all other flags except RETRACT. Neutral is commonly forward-facing and horizontal (roll=pitch=yaw=0) but may be any orientation."] const GIMBAL_DEVICE_FLAGS_NEUTRAL = 2 ; # [doc = "Lock roll angle to absolute angle relative to horizon (not relative to vehicle). This is generally the default with a stabilizing gimbal."] const GIMBAL_DEVICE_FLAGS_ROLL_LOCK = 4 ; # [doc = "Lock pitch angle to absolute angle relative to horizon (not relative to vehicle). This is generally the default with a stabilizing gimbal."] const GIMBAL_DEVICE_FLAGS_PITCH_LOCK = 8 ; # [doc = "Lock yaw angle to absolute angle relative to North (not relative to vehicle). If this flag is set, the yaw angle and z component of angular velocity are relative to North (earth frame, x-axis pointing North), else they are relative to the vehicle heading (vehicle frame, earth frame rotated so that the x-axis is pointing forward)."] const GIMBAL_DEVICE_FLAGS_YAW_LOCK = 16 ; # [doc = "Yaw angle and z component of angular velocity are relative to the vehicle heading (vehicle frame, earth frame rotated such that the x-axis is pointing forward)."] const GIMBAL_DEVICE_FLAGS_YAW_IN_VEHICLE_FRAME = 32 ; # [doc = "Yaw angle and z component of angular velocity are relative to North (earth frame, x-axis is pointing North)."] const GIMBAL_DEVICE_FLAGS_YAW_IN_EARTH_FRAME = 64 ; # [doc = "Gimbal device can accept yaw angle inputs relative to North (earth frame). This flag is only for reporting (attempts to set this flag are ignored)."] const GIMBAL_DEVICE_FLAGS_ACCEPTS_YAW_IN_EARTH_FRAME = 128 ; # [doc = "The gimbal orientation is set exclusively by the RC signals feed to the gimbal's radio control inputs. MAVLink messages for setting the gimbal orientation (GIMBAL_DEVICE_SET_ATTITUDE) are ignored."] const GIMBAL_DEVICE_FLAGS_RC_EXCLUSIVE = 256 ; # [doc = "The gimbal orientation is determined by combining/mixing the RC signals feed to the gimbal's radio control inputs and the MAVLink messages for setting the gimbal orientation (GIMBAL_DEVICE_SET_ATTITUDE). How these two controls are combined or mixed is not defined by the protocol but is up to the implementation."] const GIMBAL_DEVICE_FLAGS_RC_MIXED = 512 ; } }
980impl GimbalDeviceFlags {
981 pub const DEFAULT: Self = Self::GIMBAL_DEVICE_FLAGS_RETRACT;
982}
983impl Default for GimbalDeviceFlags {
984 fn default() -> Self {
985 Self::DEFAULT
986 }
987}
988bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Gimbal manager high level capability flags (bitmap). The first 16 bits are identical to the GIMBAL_DEVICE_CAP_FLAGS. However, the gimbal manager does not need to copy the flags from the gimbal but can also enhance the capabilities and thus add flags."] pub struct GimbalManagerCapFlags : u32 { # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_HAS_RETRACT."] const GIMBAL_MANAGER_CAP_FLAGS_HAS_RETRACT = 1 ; # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_HAS_NEUTRAL."] const GIMBAL_MANAGER_CAP_FLAGS_HAS_NEUTRAL = 2 ; # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_HAS_ROLL_AXIS."] const GIMBAL_MANAGER_CAP_FLAGS_HAS_ROLL_AXIS = 4 ; # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_HAS_ROLL_FOLLOW."] const GIMBAL_MANAGER_CAP_FLAGS_HAS_ROLL_FOLLOW = 8 ; # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_HAS_ROLL_LOCK."] const GIMBAL_MANAGER_CAP_FLAGS_HAS_ROLL_LOCK = 16 ; # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_HAS_PITCH_AXIS."] const GIMBAL_MANAGER_CAP_FLAGS_HAS_PITCH_AXIS = 32 ; # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_HAS_PITCH_FOLLOW."] const GIMBAL_MANAGER_CAP_FLAGS_HAS_PITCH_FOLLOW = 64 ; # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_HAS_PITCH_LOCK."] const GIMBAL_MANAGER_CAP_FLAGS_HAS_PITCH_LOCK = 128 ; # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_HAS_YAW_AXIS."] const GIMBAL_MANAGER_CAP_FLAGS_HAS_YAW_AXIS = 256 ; # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_HAS_YAW_FOLLOW."] const GIMBAL_MANAGER_CAP_FLAGS_HAS_YAW_FOLLOW = 512 ; # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_HAS_YAW_LOCK."] const GIMBAL_MANAGER_CAP_FLAGS_HAS_YAW_LOCK = 1024 ; # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_SUPPORTS_INFINITE_YAW."] const GIMBAL_MANAGER_CAP_FLAGS_SUPPORTS_INFINITE_YAW = 2048 ; # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_SUPPORTS_YAW_IN_EARTH_FRAME."] const GIMBAL_MANAGER_CAP_FLAGS_SUPPORTS_YAW_IN_EARTH_FRAME = 4096 ; # [doc = "Based on GIMBAL_DEVICE_CAP_FLAGS_HAS_RC_INPUTS."] const GIMBAL_MANAGER_CAP_FLAGS_HAS_RC_INPUTS = 8192 ; # [doc = "Gimbal manager supports to point to a local position."] const GIMBAL_MANAGER_CAP_FLAGS_CAN_POINT_LOCATION_LOCAL = 65536 ; # [doc = "Gimbal manager supports to point to a global latitude, longitude, altitude position."] const GIMBAL_MANAGER_CAP_FLAGS_CAN_POINT_LOCATION_GLOBAL = 131072 ; } }
989impl GimbalManagerCapFlags {
990 pub const DEFAULT: Self = Self::GIMBAL_MANAGER_CAP_FLAGS_HAS_RETRACT;
991}
992impl Default for GimbalManagerCapFlags {
993 fn default() -> Self {
994 Self::DEFAULT
995 }
996}
997bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Flags for high level gimbal manager operation The first 16 bits are identical to the GIMBAL_DEVICE_FLAGS."] pub struct GimbalManagerFlags : u32 { # [doc = "Based on GIMBAL_DEVICE_FLAGS_RETRACT."] const GIMBAL_MANAGER_FLAGS_RETRACT = 1 ; # [doc = "Based on GIMBAL_DEVICE_FLAGS_NEUTRAL."] const GIMBAL_MANAGER_FLAGS_NEUTRAL = 2 ; # [doc = "Based on GIMBAL_DEVICE_FLAGS_ROLL_LOCK."] const GIMBAL_MANAGER_FLAGS_ROLL_LOCK = 4 ; # [doc = "Based on GIMBAL_DEVICE_FLAGS_PITCH_LOCK."] const GIMBAL_MANAGER_FLAGS_PITCH_LOCK = 8 ; # [doc = "Based on GIMBAL_DEVICE_FLAGS_YAW_LOCK."] const GIMBAL_MANAGER_FLAGS_YAW_LOCK = 16 ; # [doc = "Based on GIMBAL_DEVICE_FLAGS_YAW_IN_VEHICLE_FRAME."] const GIMBAL_MANAGER_FLAGS_YAW_IN_VEHICLE_FRAME = 32 ; # [doc = "Based on GIMBAL_DEVICE_FLAGS_YAW_IN_EARTH_FRAME."] const GIMBAL_MANAGER_FLAGS_YAW_IN_EARTH_FRAME = 64 ; # [doc = "Based on GIMBAL_DEVICE_FLAGS_ACCEPTS_YAW_IN_EARTH_FRAME."] const GIMBAL_MANAGER_FLAGS_ACCEPTS_YAW_IN_EARTH_FRAME = 128 ; # [doc = "Based on GIMBAL_DEVICE_FLAGS_RC_EXCLUSIVE."] const GIMBAL_MANAGER_FLAGS_RC_EXCLUSIVE = 256 ; # [doc = "Based on GIMBAL_DEVICE_FLAGS_RC_MIXED."] const GIMBAL_MANAGER_FLAGS_RC_MIXED = 512 ; } }
998impl GimbalManagerFlags {
999 pub const DEFAULT: Self = Self::GIMBAL_MANAGER_FLAGS_RETRACT;
1000}
1001impl Default for GimbalManagerFlags {
1002 fn default() -> Self {
1003 Self::DEFAULT
1004 }
1005}
1006#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1007#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1008#[cfg_attr(feature = "serde", serde(tag = "type"))]
1009#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1010#[repr(u32)]
1011#[doc = "Type of GPS fix"]
1012pub enum GpsFixType {
1013 #[doc = "No GPS connected"]
1014 GPS_FIX_TYPE_NO_GPS = 0,
1015 #[doc = "No position information, GPS is connected"]
1016 GPS_FIX_TYPE_NO_FIX = 1,
1017 #[doc = "2D position"]
1018 GPS_FIX_TYPE_2D_FIX = 2,
1019 #[doc = "3D position"]
1020 GPS_FIX_TYPE_3D_FIX = 3,
1021 #[doc = "DGPS/SBAS aided 3D position"]
1022 GPS_FIX_TYPE_DGPS = 4,
1023 #[doc = "RTK float, 3D position"]
1024 GPS_FIX_TYPE_RTK_FLOAT = 5,
1025 #[doc = "RTK Fixed, 3D position"]
1026 GPS_FIX_TYPE_RTK_FIXED = 6,
1027 #[doc = "Static fixed, typically used for base stations"]
1028 GPS_FIX_TYPE_STATIC = 7,
1029 #[doc = "PPP, 3D position."]
1030 GPS_FIX_TYPE_PPP = 8,
1031}
1032impl GpsFixType {
1033 pub const DEFAULT: Self = Self::GPS_FIX_TYPE_NO_GPS;
1034}
1035impl Default for GpsFixType {
1036 fn default() -> Self {
1037 Self::DEFAULT
1038 }
1039}
1040bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] pub struct GpsInputIgnoreFlags : u16 { # [doc = "ignore altitude field"] const GPS_INPUT_IGNORE_FLAG_ALT = 1 ; # [doc = "ignore hdop field"] const GPS_INPUT_IGNORE_FLAG_HDOP = 2 ; # [doc = "ignore vdop field"] const GPS_INPUT_IGNORE_FLAG_VDOP = 4 ; # [doc = "ignore horizontal velocity field (vn and ve)"] const GPS_INPUT_IGNORE_FLAG_VEL_HORIZ = 8 ; # [doc = "ignore vertical velocity field (vd)"] const GPS_INPUT_IGNORE_FLAG_VEL_VERT = 16 ; # [doc = "ignore speed accuracy field"] const GPS_INPUT_IGNORE_FLAG_SPEED_ACCURACY = 32 ; # [doc = "ignore horizontal accuracy field"] const GPS_INPUT_IGNORE_FLAG_HORIZONTAL_ACCURACY = 64 ; # [doc = "ignore vertical accuracy field"] const GPS_INPUT_IGNORE_FLAG_VERTICAL_ACCURACY = 128 ; } }
1041impl GpsInputIgnoreFlags {
1042 pub const DEFAULT: Self = Self::GPS_INPUT_IGNORE_FLAG_ALT;
1043}
1044impl Default for GpsInputIgnoreFlags {
1045 fn default() -> Self {
1046 Self::DEFAULT
1047 }
1048}
1049#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1050#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1051#[cfg_attr(feature = "serde", serde(tag = "type"))]
1052#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1053#[repr(u32)]
1054#[doc = "Gripper actions."]
1055pub enum GripperActions {
1056 #[doc = "Gripper release cargo."]
1057 GRIPPER_ACTION_RELEASE = 0,
1058 #[doc = "Gripper grab onto cargo."]
1059 GRIPPER_ACTION_GRAB = 1,
1060}
1061impl GripperActions {
1062 pub const DEFAULT: Self = Self::GRIPPER_ACTION_RELEASE;
1063}
1064impl Default for GripperActions {
1065 fn default() -> Self {
1066 Self::DEFAULT
1067 }
1068}
1069bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Flags in the HIGHRES_IMU message indicate which fields have updated since the last message"] pub struct HighresImuUpdatedFlags : u16 { # [doc = "The value in the xacc field has been updated"] const HIGHRES_IMU_UPDATED_XACC = 1 ; # [doc = "The value in the yacc field has been updated"] const HIGHRES_IMU_UPDATED_YACC = 2 ; # [doc = "The value in the zacc field has been updated since"] const HIGHRES_IMU_UPDATED_ZACC = 4 ; # [doc = "The value in the xgyro field has been updated"] const HIGHRES_IMU_UPDATED_XGYRO = 8 ; # [doc = "The value in the ygyro field has been updated"] const HIGHRES_IMU_UPDATED_YGYRO = 16 ; # [doc = "The value in the zgyro field has been updated"] const HIGHRES_IMU_UPDATED_ZGYRO = 32 ; # [doc = "The value in the xmag field has been updated"] const HIGHRES_IMU_UPDATED_XMAG = 64 ; # [doc = "The value in the ymag field has been updated"] const HIGHRES_IMU_UPDATED_YMAG = 128 ; # [doc = "The value in the zmag field has been updated"] const HIGHRES_IMU_UPDATED_ZMAG = 256 ; # [doc = "The value in the abs_pressure field has been updated"] const HIGHRES_IMU_UPDATED_ABS_PRESSURE = 512 ; # [doc = "The value in the diff_pressure field has been updated"] const HIGHRES_IMU_UPDATED_DIFF_PRESSURE = 1024 ; # [doc = "The value in the pressure_alt field has been updated"] const HIGHRES_IMU_UPDATED_PRESSURE_ALT = 2048 ; # [doc = "The value in the temperature field has been updated"] const HIGHRES_IMU_UPDATED_TEMPERATURE = 4096 ; } }
1070impl HighresImuUpdatedFlags {
1071 pub const DEFAULT: Self = Self::HIGHRES_IMU_UPDATED_XACC;
1072}
1073impl Default for HighresImuUpdatedFlags {
1074 fn default() -> Self {
1075 Self::DEFAULT
1076 }
1077}
1078bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Flags used in HIL_ACTUATOR_CONTROLS message."] pub struct HilActuatorControlsFlags : u64 { # [doc = "Simulation is using lockstep"] const HIL_ACTUATOR_CONTROLS_FLAGS_LOCKSTEP = 1 ; } }
1079impl HilActuatorControlsFlags {
1080 pub const DEFAULT: Self = Self::HIL_ACTUATOR_CONTROLS_FLAGS_LOCKSTEP;
1081}
1082impl Default for HilActuatorControlsFlags {
1083 fn default() -> Self {
1084 Self::DEFAULT
1085 }
1086}
1087bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Flags in the HIL_SENSOR message indicate which fields have updated since the last message"] pub struct HilSensorUpdatedFlags : u32 { # [doc = "The value in the xacc field has been updated"] const HIL_SENSOR_UPDATED_XACC = 1 ; # [doc = "The value in the yacc field has been updated"] const HIL_SENSOR_UPDATED_YACC = 2 ; # [doc = "The value in the zacc field has been updated"] const HIL_SENSOR_UPDATED_ZACC = 4 ; # [doc = "The value in the xgyro field has been updated"] const HIL_SENSOR_UPDATED_XGYRO = 8 ; # [doc = "The value in the ygyro field has been updated"] const HIL_SENSOR_UPDATED_YGYRO = 16 ; # [doc = "The value in the zgyro field has been updated"] const HIL_SENSOR_UPDATED_ZGYRO = 32 ; # [doc = "The value in the xmag field has been updated"] const HIL_SENSOR_UPDATED_XMAG = 64 ; # [doc = "The value in the ymag field has been updated"] const HIL_SENSOR_UPDATED_YMAG = 128 ; # [doc = "The value in the zmag field has been updated"] const HIL_SENSOR_UPDATED_ZMAG = 256 ; # [doc = "The value in the abs_pressure field has been updated"] const HIL_SENSOR_UPDATED_ABS_PRESSURE = 512 ; # [doc = "The value in the diff_pressure field has been updated"] const HIL_SENSOR_UPDATED_DIFF_PRESSURE = 1024 ; # [doc = "The value in the pressure_alt field has been updated"] const HIL_SENSOR_UPDATED_PRESSURE_ALT = 2048 ; # [doc = "The value in the temperature field has been updated"] const HIL_SENSOR_UPDATED_TEMPERATURE = 4096 ; # [doc = "Full reset of attitude/position/velocities/etc was performed in sim (Bit 31)."] const HIL_SENSOR_UPDATED_RESET = 2147483648 ; } }
1088impl HilSensorUpdatedFlags {
1089 pub const DEFAULT: Self = Self::HIL_SENSOR_UPDATED_XACC;
1090}
1091impl Default for HilSensorUpdatedFlags {
1092 fn default() -> Self {
1093 Self::DEFAULT
1094 }
1095}
1096bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Flags to report failure cases over the high latency telemetry."] pub struct HlFailureFlag : u16 { # [doc = "GPS failure."] const HL_FAILURE_FLAG_GPS = 1 ; # [doc = "Differential pressure sensor failure."] const HL_FAILURE_FLAG_DIFFERENTIAL_PRESSURE = 2 ; # [doc = "Absolute pressure sensor failure."] const HL_FAILURE_FLAG_ABSOLUTE_PRESSURE = 4 ; # [doc = "Accelerometer sensor failure."] const HL_FAILURE_FLAG_3D_ACCEL = 8 ; # [doc = "Gyroscope sensor failure."] const HL_FAILURE_FLAG_3D_GYRO = 16 ; # [doc = "Magnetometer sensor failure."] const HL_FAILURE_FLAG_3D_MAG = 32 ; # [doc = "Terrain subsystem failure."] const HL_FAILURE_FLAG_TERRAIN = 64 ; # [doc = "Battery failure/critical low battery."] const HL_FAILURE_FLAG_BATTERY = 128 ; # [doc = "RC receiver failure/no RC connection."] const HL_FAILURE_FLAG_RC_RECEIVER = 256 ; # [doc = "Offboard link failure."] const HL_FAILURE_FLAG_OFFBOARD_LINK = 512 ; # [doc = "Engine failure."] const HL_FAILURE_FLAG_ENGINE = 1024 ; # [doc = "Geofence violation."] const HL_FAILURE_FLAG_GEOFENCE = 2048 ; # [doc = "Estimator failure, for example measurement rejection or large variances."] const HL_FAILURE_FLAG_ESTIMATOR = 4096 ; # [doc = "Mission failure."] const HL_FAILURE_FLAG_MISSION = 8192 ; } }
1097impl HlFailureFlag {
1098 pub const DEFAULT: Self = Self::HL_FAILURE_FLAG_GPS;
1099}
1100impl Default for HlFailureFlag {
1101 fn default() -> Self {
1102 Self::DEFAULT
1103 }
1104}
1105bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Illuminator module error flags (bitmap, 0 means no error)"] pub struct IlluminatorErrorFlags : u32 { # [doc = "Illuminator thermal throttling error."] const ILLUMINATOR_ERROR_FLAGS_THERMAL_THROTTLING = 1 ; # [doc = "Illuminator over temperature shutdown error."] const ILLUMINATOR_ERROR_FLAGS_OVER_TEMPERATURE_SHUTDOWN = 2 ; # [doc = "Illuminator thermistor failure."] const ILLUMINATOR_ERROR_FLAGS_THERMISTOR_FAILURE = 4 ; } }
1106impl IlluminatorErrorFlags {
1107 pub const DEFAULT: Self = Self::ILLUMINATOR_ERROR_FLAGS_THERMAL_THROTTLING;
1108}
1109impl Default for IlluminatorErrorFlags {
1110 fn default() -> Self {
1111 Self::DEFAULT
1112 }
1113}
1114#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1115#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1116#[cfg_attr(feature = "serde", serde(tag = "type"))]
1117#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1118#[repr(u32)]
1119#[doc = "Modes of illuminator"]
1120pub enum IlluminatorMode {
1121 #[doc = "Illuminator mode is not specified/unknown"]
1122 ILLUMINATOR_MODE_UNKNOWN = 0,
1123 #[doc = "Illuminator behavior is controlled by MAV_CMD_DO_ILLUMINATOR_CONFIGURE settings"]
1124 ILLUMINATOR_MODE_INTERNAL_CONTROL = 1,
1125 #[doc = "Illuminator behavior is controlled by external factors: e.g. an external hardware signal"]
1126 ILLUMINATOR_MODE_EXTERNAL_SYNC = 2,
1127}
1128impl IlluminatorMode {
1129 pub const DEFAULT: Self = Self::ILLUMINATOR_MODE_UNKNOWN;
1130}
1131impl Default for IlluminatorMode {
1132 fn default() -> Self {
1133 Self::DEFAULT
1134 }
1135}
1136#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1137#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1138#[cfg_attr(feature = "serde", serde(tag = "type"))]
1139#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1140#[repr(u32)]
1141#[doc = "Type of landing target"]
1142pub enum LandingTargetType {
1143 #[doc = "Landing target signaled by light beacon (ex: IR-LOCK)"]
1144 LANDING_TARGET_TYPE_LIGHT_BEACON = 0,
1145 #[doc = "Landing target signaled by radio beacon (ex: ILS, NDB)"]
1146 LANDING_TARGET_TYPE_RADIO_BEACON = 1,
1147 #[doc = "Landing target represented by a fiducial marker (ex: ARTag)"]
1148 LANDING_TARGET_TYPE_VISION_FIDUCIAL = 2,
1149 #[doc = "Landing target represented by a pre-defined visual shape/feature (ex: X-marker, H-marker, square)"]
1150 LANDING_TARGET_TYPE_VISION_OTHER = 3,
1151}
1152impl LandingTargetType {
1153 pub const DEFAULT: Self = Self::LANDING_TARGET_TYPE_LIGHT_BEACON;
1154}
1155impl Default for LandingTargetType {
1156 fn default() -> Self {
1157 Self::DEFAULT
1158 }
1159}
1160#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1161#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1162#[cfg_attr(feature = "serde", serde(tag = "type"))]
1163#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1164#[repr(u32)]
1165pub enum MagCalStatus {
1166 MAG_CAL_NOT_STARTED = 0,
1167 MAG_CAL_WAITING_TO_START = 1,
1168 MAG_CAL_RUNNING_STEP_ONE = 2,
1169 MAG_CAL_RUNNING_STEP_TWO = 3,
1170 MAG_CAL_SUCCESS = 4,
1171 MAG_CAL_FAILED = 5,
1172 MAG_CAL_BAD_ORIENTATION = 6,
1173 MAG_CAL_BAD_RADIUS = 7,
1174}
1175impl MagCalStatus {
1176 pub const DEFAULT: Self = Self::MAG_CAL_NOT_STARTED;
1177}
1178impl Default for MagCalStatus {
1179 fn default() -> Self {
1180 Self::DEFAULT
1181 }
1182}
1183#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1184#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1185#[cfg_attr(feature = "serde", serde(tag = "type"))]
1186#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1187#[repr(u32)]
1188pub enum MavArmAuthDeniedReason {
1189 #[doc = "Not a specific reason"]
1190 MAV_ARM_AUTH_DENIED_REASON_GENERIC = 0,
1191 #[doc = "Authorizer will send the error as string to GCS"]
1192 MAV_ARM_AUTH_DENIED_REASON_NONE = 1,
1193 #[doc = "At least one waypoint have a invalid value"]
1194 MAV_ARM_AUTH_DENIED_REASON_INVALID_WAYPOINT = 2,
1195 #[doc = "Timeout in the authorizer process(in case it depends on network)"]
1196 MAV_ARM_AUTH_DENIED_REASON_TIMEOUT = 3,
1197 #[doc = "Airspace of the mission in use by another vehicle, second result parameter can have the waypoint id that caused it to be denied."]
1198 MAV_ARM_AUTH_DENIED_REASON_AIRSPACE_IN_USE = 4,
1199 #[doc = "Weather is not good to fly"]
1200 MAV_ARM_AUTH_DENIED_REASON_BAD_WEATHER = 5,
1201}
1202impl MavArmAuthDeniedReason {
1203 pub const DEFAULT: Self = Self::MAV_ARM_AUTH_DENIED_REASON_GENERIC;
1204}
1205impl Default for MavArmAuthDeniedReason {
1206 fn default() -> Self {
1207 Self::DEFAULT
1208 }
1209}
1210#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1211#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1212#[cfg_attr(feature = "serde", serde(tag = "type"))]
1213#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1214#[repr(u32)]
1215#[doc = "Micro air vehicle / autopilot classes. This identifies the individual model."]
1216pub enum MavAutopilot {
1217 #[doc = "Generic autopilot, full support for everything"]
1218 MAV_AUTOPILOT_GENERIC = 0,
1219 #[doc = "Reserved for future use."]
1220 MAV_AUTOPILOT_RESERVED = 1,
1221 #[doc = "SLUGS autopilot, <http://slugsuav.soe.ucsc.edu>"]
1222 MAV_AUTOPILOT_SLUGS = 2,
1223 #[doc = "ArduPilot - Plane/Copter/Rover/Sub/Tracker, <https://ardupilot.org>"]
1224 MAV_AUTOPILOT_ARDUPILOTMEGA = 3,
1225 #[doc = "OpenPilot, <http://openpilot.org>"]
1226 MAV_AUTOPILOT_OPENPILOT = 4,
1227 #[doc = "Generic autopilot only supporting simple waypoints"]
1228 MAV_AUTOPILOT_GENERIC_WAYPOINTS_ONLY = 5,
1229 #[doc = "Generic autopilot supporting waypoints and other simple navigation commands"]
1230 MAV_AUTOPILOT_GENERIC_WAYPOINTS_AND_SIMPLE_NAVIGATION_ONLY = 6,
1231 #[doc = "Generic autopilot supporting the full mission command set"]
1232 MAV_AUTOPILOT_GENERIC_MISSION_FULL = 7,
1233 #[doc = "No valid autopilot, e.g. a GCS or other MAVLink component"]
1234 MAV_AUTOPILOT_INVALID = 8,
1235 #[doc = "PPZ UAV - <http://nongnu.org/paparazzi>"]
1236 MAV_AUTOPILOT_PPZ = 9,
1237 #[doc = "UAV Dev Board"]
1238 MAV_AUTOPILOT_UDB = 10,
1239 #[doc = "FlexiPilot"]
1240 MAV_AUTOPILOT_FP = 11,
1241 #[doc = "PX4 Autopilot - <http://px4.io/>"]
1242 MAV_AUTOPILOT_PX4 = 12,
1243 #[doc = "SMACCMPilot - <http://smaccmpilot.org>"]
1244 MAV_AUTOPILOT_SMACCMPILOT = 13,
1245 #[doc = "AutoQuad -- <http://autoquad.org>"]
1246 MAV_AUTOPILOT_AUTOQUAD = 14,
1247 #[doc = "Armazila -- <http://armazila.com>"]
1248 MAV_AUTOPILOT_ARMAZILA = 15,
1249 #[doc = "Aerob -- <http://aerob.ru>"]
1250 MAV_AUTOPILOT_AEROB = 16,
1251 #[doc = "ASLUAV autopilot -- <http://www.asl.ethz.ch>"]
1252 MAV_AUTOPILOT_ASLUAV = 17,
1253 #[doc = "SmartAP Autopilot - <http://sky-drones.com>"]
1254 MAV_AUTOPILOT_SMARTAP = 18,
1255 #[doc = "AirRails - <http://uaventure.com>"]
1256 MAV_AUTOPILOT_AIRRAILS = 19,
1257 #[doc = "Fusion Reflex - <https://fusion.engineering>"]
1258 MAV_AUTOPILOT_REFLEX = 20,
1259}
1260impl MavAutopilot {
1261 pub const DEFAULT: Self = Self::MAV_AUTOPILOT_GENERIC;
1262}
1263impl Default for MavAutopilot {
1264 fn default() -> Self {
1265 Self::DEFAULT
1266 }
1267}
1268#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1269#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1270#[cfg_attr(feature = "serde", serde(tag = "type"))]
1271#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1272#[repr(u32)]
1273pub enum MavAvssCommandFailureReason {
1274 #[doc = "AVSS defined command failure reason. PRS not steady."]
1275 PRS_NOT_STEADY = 1,
1276 #[doc = "AVSS defined command failure reason. PRS DTM not armed."]
1277 PRS_DTM_NOT_ARMED = 2,
1278 #[doc = "AVSS defined command failure reason. PRS OTM not armed."]
1279 PRS_OTM_NOT_ARMED = 3,
1280}
1281impl MavAvssCommandFailureReason {
1282 pub const DEFAULT: Self = Self::PRS_NOT_STEADY;
1283}
1284impl Default for MavAvssCommandFailureReason {
1285 fn default() -> Self {
1286 Self::DEFAULT
1287 }
1288}
1289#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1290#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1291#[cfg_attr(feature = "serde", serde(tag = "type"))]
1292#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1293#[repr(u32)]
1294#[doc = "Enumeration for battery charge states."]
1295pub enum MavBatteryChargeState {
1296 #[doc = "Low battery state is not provided"]
1297 MAV_BATTERY_CHARGE_STATE_UNDEFINED = 0,
1298 #[doc = "Battery is not in low state. Normal operation."]
1299 MAV_BATTERY_CHARGE_STATE_OK = 1,
1300 #[doc = "Battery state is low, warn and monitor close."]
1301 MAV_BATTERY_CHARGE_STATE_LOW = 2,
1302 #[doc = "Battery state is critical, return or abort immediately."]
1303 MAV_BATTERY_CHARGE_STATE_CRITICAL = 3,
1304 #[doc = "Battery state is too low for ordinary abort sequence. Perform fastest possible emergency stop to prevent damage."]
1305 MAV_BATTERY_CHARGE_STATE_EMERGENCY = 4,
1306 #[doc = "Battery failed, damage unavoidable. Possible causes (faults) are listed in MAV_BATTERY_FAULT."]
1307 MAV_BATTERY_CHARGE_STATE_FAILED = 5,
1308 #[doc = "Battery is diagnosed to be defective or an error occurred, usage is discouraged / prohibited. Possible causes (faults) are listed in MAV_BATTERY_FAULT."]
1309 MAV_BATTERY_CHARGE_STATE_UNHEALTHY = 6,
1310 #[doc = "Battery is charging."]
1311 MAV_BATTERY_CHARGE_STATE_CHARGING = 7,
1312}
1313impl MavBatteryChargeState {
1314 pub const DEFAULT: Self = Self::MAV_BATTERY_CHARGE_STATE_UNDEFINED;
1315}
1316impl Default for MavBatteryChargeState {
1317 fn default() -> Self {
1318 Self::DEFAULT
1319 }
1320}
1321bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Smart battery supply status/fault flags (bitmask) for health indication. The battery must also report either MAV_BATTERY_CHARGE_STATE_FAILED or MAV_BATTERY_CHARGE_STATE_UNHEALTHY if any of these are set."] pub struct MavBatteryFault : u32 { # [doc = "Battery has deep discharged."] const MAV_BATTERY_FAULT_DEEP_DISCHARGE = 1 ; # [doc = "Voltage spikes."] const MAV_BATTERY_FAULT_SPIKES = 2 ; # [doc = "One or more cells have failed. Battery should also report MAV_BATTERY_CHARGE_STATE_FAILE (and should not be used)."] const MAV_BATTERY_FAULT_CELL_FAIL = 4 ; # [doc = "Over-current fault."] const MAV_BATTERY_FAULT_OVER_CURRENT = 8 ; # [doc = "Over-temperature fault."] const MAV_BATTERY_FAULT_OVER_TEMPERATURE = 16 ; # [doc = "Under-temperature fault."] const MAV_BATTERY_FAULT_UNDER_TEMPERATURE = 32 ; # [doc = "Vehicle voltage is not compatible with this battery (batteries on same power rail should have similar voltage)."] const MAV_BATTERY_FAULT_INCOMPATIBLE_VOLTAGE = 64 ; # [doc = "Battery firmware is not compatible with current autopilot firmware."] const MAV_BATTERY_FAULT_INCOMPATIBLE_FIRMWARE = 128 ; # [doc = "Battery is not compatible due to cell configuration (e.g. 5s1p when vehicle requires 6s)."] const BATTERY_FAULT_INCOMPATIBLE_CELLS_CONFIGURATION = 256 ; } }
1322impl MavBatteryFault {
1323 pub const DEFAULT: Self = Self::MAV_BATTERY_FAULT_DEEP_DISCHARGE;
1324}
1325impl Default for MavBatteryFault {
1326 fn default() -> Self {
1327 Self::DEFAULT
1328 }
1329}
1330#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1331#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1332#[cfg_attr(feature = "serde", serde(tag = "type"))]
1333#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1334#[repr(u32)]
1335#[doc = "Enumeration of battery functions"]
1336pub enum MavBatteryFunction {
1337 #[doc = "Battery function is unknown"]
1338 MAV_BATTERY_FUNCTION_UNKNOWN = 0,
1339 #[doc = "Battery supports all flight systems"]
1340 MAV_BATTERY_FUNCTION_ALL = 1,
1341 #[doc = "Battery for the propulsion system"]
1342 MAV_BATTERY_FUNCTION_PROPULSION = 2,
1343 #[doc = "Avionics battery"]
1344 MAV_BATTERY_FUNCTION_AVIONICS = 3,
1345 #[doc = "Payload battery"]
1346 MAV_BATTERY_FUNCTION_PAYLOAD = 4,
1347}
1348impl MavBatteryFunction {
1349 pub const DEFAULT: Self = Self::MAV_BATTERY_FUNCTION_UNKNOWN;
1350}
1351impl Default for MavBatteryFunction {
1352 fn default() -> Self {
1353 Self::DEFAULT
1354 }
1355}
1356#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1357#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1358#[cfg_attr(feature = "serde", serde(tag = "type"))]
1359#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1360#[repr(u32)]
1361#[doc = "Battery mode. Note, the normal operation mode (i.e. when flying) should be reported as MAV_BATTERY_MODE_UNKNOWN to allow message trimming in normal flight."]
1362pub enum MavBatteryMode {
1363 #[doc = "Battery mode not supported/unknown battery mode/normal operation."]
1364 MAV_BATTERY_MODE_UNKNOWN = 0,
1365 #[doc = "Battery is auto discharging (towards storage level)."]
1366 MAV_BATTERY_MODE_AUTO_DISCHARGING = 1,
1367 #[doc = "Battery in hot-swap mode (current limited to prevent spikes that might damage sensitive electrical circuits)."]
1368 MAV_BATTERY_MODE_HOT_SWAP = 2,
1369}
1370impl MavBatteryMode {
1371 pub const DEFAULT: Self = Self::MAV_BATTERY_MODE_UNKNOWN;
1372}
1373impl Default for MavBatteryMode {
1374 fn default() -> Self {
1375 Self::DEFAULT
1376 }
1377}
1378#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1379#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1380#[cfg_attr(feature = "serde", serde(tag = "type"))]
1381#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1382#[repr(u32)]
1383#[doc = "Enumeration of battery types"]
1384pub enum MavBatteryType {
1385 #[doc = "Not specified."]
1386 MAV_BATTERY_TYPE_UNKNOWN = 0,
1387 #[doc = "Lithium polymer battery"]
1388 MAV_BATTERY_TYPE_LIPO = 1,
1389 #[doc = "Lithium-iron-phosphate battery"]
1390 MAV_BATTERY_TYPE_LIFE = 2,
1391 #[doc = "Lithium-ION battery"]
1392 MAV_BATTERY_TYPE_LION = 3,
1393 #[doc = "Nickel metal hydride battery"]
1394 MAV_BATTERY_TYPE_NIMH = 4,
1395}
1396impl MavBatteryType {
1397 pub const DEFAULT: Self = Self::MAV_BATTERY_TYPE_UNKNOWN;
1398}
1399impl Default for MavBatteryType {
1400 fn default() -> Self {
1401 Self::DEFAULT
1402 }
1403}
1404#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1405#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1406#[cfg_attr(feature = "serde", serde(tag = "type"))]
1407#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1408#[repr(u32)]
1409#[doc = "Commands to be executed by the MAV. They can be executed on user request, or as part of a mission script. If the action is used in a mission, the parameter mapping to the waypoint/mission message is as follows: Param 1, Param 2, Param 3, Param 4, X: Param 5, Y:Param 6, Z:Param 7. This command list is similar what ARINC 424 is for commercial aircraft: A data format how to interpret waypoint/mission data. NaN and INT32_MAX may be used in float/integer params (respectively) to indicate optional/default values (e.g. to use the component's current yaw or latitude rather than a specific value). See <https://mavlink.io/en/guide/xml_schema.html#MAV_CMD> for information about the structure of the MAV_CMD entries"]
1410pub enum MavCmd {
1411 #[doc = "Navigate to waypoint. This is intended for use in missions (for guided commands outside of missions use MAV_CMD_DO_REPOSITION)."]
1412 MAV_CMD_NAV_WAYPOINT = 16,
1413 #[doc = "Loiter around this waypoint an unlimited amount of time"]
1414 MAV_CMD_NAV_LOITER_UNLIM = 17,
1415 #[doc = "Loiter around this waypoint for X turns"]
1416 MAV_CMD_NAV_LOITER_TURNS = 18,
1417 #[doc = "Loiter at the specified latitude, longitude and altitude for a certain amount of time. Multicopter vehicles stop at the point (within a vehicle-specific acceptance radius). Forward-only moving vehicles (e.g. fixed-wing) circle the point with the specified radius/direction. If the Heading Required parameter (2) is non-zero forward moving aircraft will only leave the loiter circle once heading towards the next waypoint."]
1418 MAV_CMD_NAV_LOITER_TIME = 19,
1419 #[doc = "Return to launch location"]
1420 MAV_CMD_NAV_RETURN_TO_LAUNCH = 20,
1421 #[doc = "Land at location."]
1422 MAV_CMD_NAV_LAND = 21,
1423 #[doc = "Takeoff from ground / hand. Vehicles that support multiple takeoff modes (e.g. VTOL quadplane) should take off using the currently configured mode."]
1424 MAV_CMD_NAV_TAKEOFF = 22,
1425 #[doc = "Land at local position (local frame only)"]
1426 MAV_CMD_NAV_LAND_LOCAL = 23,
1427 #[doc = "Takeoff from local position (local frame only)"]
1428 MAV_CMD_NAV_TAKEOFF_LOCAL = 24,
1429 #[doc = "Vehicle following, i.e. this waypoint represents the position of a moving vehicle"]
1430 MAV_CMD_NAV_FOLLOW = 25,
1431 #[doc = "Continue on the current course and climb/descend to specified altitude. When the altitude is reached continue to the next command (i.e., don't proceed to the next command until the desired altitude is reached."]
1432 MAV_CMD_NAV_CONTINUE_AND_CHANGE_ALT = 30,
1433 #[doc = "Begin loiter at the specified Latitude and Longitude. If Lat=Lon=0, then loiter at the current position. Don't consider the navigation command complete (don't leave loiter) until the altitude has been reached. Additionally, if the Heading Required parameter is non-zero the aircraft will not leave the loiter until heading toward the next waypoint."]
1434 MAV_CMD_NAV_LOITER_TO_ALT = 31,
1435 #[doc = "Begin following a target"]
1436 MAV_CMD_DO_FOLLOW = 32,
1437 #[doc = "Reposition the MAV after a follow target command has been sent"]
1438 MAV_CMD_DO_FOLLOW_REPOSITION = 33,
1439 #[doc = "Start orbiting on the circumference of a circle defined by the parameters. Setting values to NaN/INT32_MAX (as appropriate) results in using defaults."]
1440 MAV_CMD_DO_ORBIT = 34,
1441 #[deprecated = " See `MAV_CMD_DO_SET_ROI_*` (Deprecated since 2018-01)"]
1442 #[doc = "Sets the region of interest (ROI) for a sensor set or the vehicle itself. This can then be used by the vehicle's control system to control the vehicle attitude and the attitude of various sensors such as cameras."]
1443 MAV_CMD_NAV_ROI = 80,
1444 #[doc = "Control autonomous path planning on the MAV."]
1445 MAV_CMD_NAV_PATHPLANNING = 81,
1446 #[doc = "Navigate to waypoint using a spline path."]
1447 MAV_CMD_NAV_SPLINE_WAYPOINT = 82,
1448 #[doc = "Takeoff from ground using VTOL mode, and transition to forward flight with specified heading. The command should be ignored by vehicles that dont support both VTOL and fixed-wing flight (multicopters, boats,etc.)."]
1449 MAV_CMD_NAV_VTOL_TAKEOFF = 84,
1450 #[doc = "Land using VTOL mode"]
1451 MAV_CMD_NAV_VTOL_LAND = 85,
1452 #[doc = "hand control over to an external controller"]
1453 MAV_CMD_NAV_GUIDED_ENABLE = 92,
1454 #[doc = "Delay the next navigation command a number of seconds or until a specified time"]
1455 MAV_CMD_NAV_DELAY = 93,
1456 #[doc = "Descend and place payload. Vehicle moves to specified location, descends until it detects a hanging payload has reached the ground, and then releases the payload. If ground is not detected before the reaching the maximum descent value (param1), the command will complete without releasing the payload."]
1457 MAV_CMD_NAV_PAYLOAD_PLACE = 94,
1458 #[doc = "NOP - This command is only used to mark the upper limit of the NAV/ACTION commands in the enumeration"]
1459 MAV_CMD_NAV_LAST = 95,
1460 #[doc = "Delay mission state machine."]
1461 MAV_CMD_CONDITION_DELAY = 112,
1462 #[doc = "Ascend/descend to target altitude at specified rate. Delay mission state machine until desired altitude reached."]
1463 MAV_CMD_CONDITION_CHANGE_ALT = 113,
1464 #[doc = "Delay mission state machine until within desired distance of next NAV point."]
1465 MAV_CMD_CONDITION_DISTANCE = 114,
1466 #[doc = "Reach a certain target angle."]
1467 MAV_CMD_CONDITION_YAW = 115,
1468 #[doc = "NOP - This command is only used to mark the upper limit of the CONDITION commands in the enumeration"]
1469 MAV_CMD_CONDITION_LAST = 159,
1470 #[doc = "Set system mode."]
1471 MAV_CMD_DO_SET_MODE = 176,
1472 #[doc = "Jump to the desired command in the mission list. Repeat this action only the specified number of times"]
1473 MAV_CMD_DO_JUMP = 177,
1474 #[doc = "Change speed and/or throttle set points. The value persists until it is overridden or there is a mode change"]
1475 MAV_CMD_DO_CHANGE_SPEED = 178,
1476 #[doc = "Sets the home position to either to the current position or a specified position. The home position is the default position that the system will return to and land on. The position is set automatically by the system during the takeoff (and may also be set using this command). Note: the current home position may be emitted in a HOME_POSITION message on request (using MAV_CMD_REQUEST_MESSAGE with param1=242)."]
1477 MAV_CMD_DO_SET_HOME = 179,
1478 #[deprecated = " See `PARAM_SET` (Deprecated since 2024-04)"]
1479 #[doc = "Set a system parameter. Caution! Use of this command requires knowledge of the numeric enumeration value of the parameter."]
1480 MAV_CMD_DO_SET_PARAMETER = 180,
1481 #[doc = "Set a relay to a condition."]
1482 MAV_CMD_DO_SET_RELAY = 181,
1483 #[doc = "Cycle a relay on and off for a desired number of cycles with a desired period."]
1484 MAV_CMD_DO_REPEAT_RELAY = 182,
1485 #[doc = "Set a servo to a desired PWM value."]
1486 MAV_CMD_DO_SET_SERVO = 183,
1487 #[doc = "Cycle a between its nominal setting and a desired PWM for a desired number of cycles with a desired period."]
1488 MAV_CMD_DO_REPEAT_SERVO = 184,
1489 #[doc = "0.5); the ACK should be either MAV_RESULT_FAILED or MAV_RESULT_UNSUPPORTED."]
1490 MAV_CMD_DO_FLIGHTTERMINATION = 185,
1491 #[doc = "Change altitude set point."]
1492 MAV_CMD_DO_CHANGE_ALTITUDE = 186,
1493 #[doc = "Sets actuators (e.g. servos) to a desired value. The actuator numbers are mapped to specific outputs (e.g. on any MAIN or AUX PWM or UAVCAN) using a flight-stack specific mechanism (i.e. a parameter)."]
1494 MAV_CMD_DO_SET_ACTUATOR = 187,
1495 #[doc = "Mission item to specify the start of a failsafe/landing return-path segment (the end of the segment is the next MAV_CMD_DO_LAND_START item). A vehicle that is using missions for landing (e.g. in a return mode) will join the mission on the closest path of the return-path segment (instead of MAV_CMD_DO_LAND_START or the nearest waypoint). The main use case is to minimize the failsafe flight path in corridor missions, where the inbound/outbound paths are constrained (by geofences) to the same particular path. The MAV_CMD_NAV_RETURN_PATH_START would be placed at the start of the return path. If a failsafe occurs on the outbound path the vehicle will move to the nearest point on the return path (which is parallel for this kind of mission), effectively turning round and following the shortest path to landing. If a failsafe occurs on the inbound path the vehicle is already on the return segment and will continue to landing. The Latitude/Longitude/Altitude are optional, and may be set to 0 if not needed. If specified, the item defines the waypoint at which the return segment starts. If sent using as a command, the vehicle will perform a mission landing (using the land segment if defined) or reject the command if mission landings are not supported, or no mission landing is defined. When used as a command any position information in the command is ignored."]
1496 MAV_CMD_DO_RETURN_PATH_START = 188,
1497 #[doc = "Mission item to mark the start of a mission landing pattern, or a command to land with a mission landing pattern. When used in a mission, this is a marker for the start of a sequence of mission items that represent a landing pattern. It should be followed by a navigation item that defines the first waypoint of the landing sequence. The start marker positional params are used only for selecting what landing pattern to use if several are defined in the mission (the selected pattern will be the one with the marker position that is closest to the vehicle when a landing is commanded). If the marker item position has zero-values for latitude, longitude, and altitude, then landing pattern selection is instead based on the position of the first waypoint in the landing sequence. \t When sent as a command it triggers a landing using a mission landing pattern. \t The location parameters are not used in this case, and should be set to 0."]
1498 MAV_CMD_DO_LAND_START = 189,
1499 #[doc = "Mission command to perform a landing from a rally point."]
1500 MAV_CMD_DO_RALLY_LAND = 190,
1501 #[doc = "Mission command to safely abort an autonomous landing."]
1502 MAV_CMD_DO_GO_AROUND = 191,
1503 #[doc = "Reposition the vehicle to a specific WGS84 global position. This command is intended for guided commands (for missions use MAV_CMD_NAV_WAYPOINT instead)."]
1504 MAV_CMD_DO_REPOSITION = 192,
1505 #[doc = "If in a GPS controlled position mode, hold the current position or continue."]
1506 MAV_CMD_DO_PAUSE_CONTINUE = 193,
1507 #[doc = "Set moving direction to forward or reverse."]
1508 MAV_CMD_DO_SET_REVERSE = 194,
1509 #[doc = "Sets the region of interest (ROI) to a location. This can then be used by the vehicle's control system to control the vehicle attitude and the attitude of various sensors such as cameras. This command can be sent to a gimbal manager but not to a gimbal device. A gimbal is not to react to this message."]
1510 MAV_CMD_DO_SET_ROI_LOCATION = 195,
1511 #[doc = "Sets the region of interest (ROI) to be toward next waypoint, with optional pitch/roll/yaw offset. This can then be used by the vehicle's control system to control the vehicle attitude and the attitude of various sensors such as cameras. This command can be sent to a gimbal manager but not to a gimbal device. A gimbal device is not to react to this message."]
1512 MAV_CMD_DO_SET_ROI_WPNEXT_OFFSET = 196,
1513 #[doc = "Cancels any previous ROI command returning the vehicle/sensors to default flight characteristics. This can then be used by the vehicle's control system to control the vehicle attitude and the attitude of various sensors such as cameras. This command can be sent to a gimbal manager but not to a gimbal device. A gimbal device is not to react to this message. After this command the gimbal manager should go back to manual input if available, and otherwise assume a neutral position."]
1514 MAV_CMD_DO_SET_ROI_NONE = 197,
1515 #[doc = "Mount tracks system with specified system ID. Determination of target vehicle position may be done with GLOBAL_POSITION_INT or any other means. This command can be sent to a gimbal manager but not to a gimbal device. A gimbal device is not to react to this message."]
1516 MAV_CMD_DO_SET_ROI_SYSID = 198,
1517 #[doc = "Control onboard camera system."]
1518 MAV_CMD_DO_CONTROL_VIDEO = 200,
1519 #[deprecated = " See `MAV_CMD_DO_SET_ROI_*` (Deprecated since 2018-01)"]
1520 #[doc = "Sets the region of interest (ROI) for a sensor set or the vehicle itself. This can then be used by the vehicle's control system to control the vehicle attitude and the attitude of various sensors such as cameras."]
1521 MAV_CMD_DO_SET_ROI = 201,
1522 #[doc = "Configure digital camera. This is a fallback message for systems that have not yet implemented PARAM_EXT_XXX messages and camera definition files (see <https://mavlink.io/en/services/camera_def.html> )."]
1523 MAV_CMD_DO_DIGICAM_CONFIGURE = 202,
1524 #[doc = "Control digital camera. This is a fallback message for systems that have not yet implemented PARAM_EXT_XXX messages and camera definition files (see <https://mavlink.io/en/services/camera_def.html> )."]
1525 MAV_CMD_DO_DIGICAM_CONTROL = 203,
1526 #[deprecated = "This message has been superseded by MAV_CMD_DO_GIMBAL_MANAGER_CONFIGURE. The message can still be used to communicate with legacy gimbals implementing it. See `MAV_CMD_DO_GIMBAL_MANAGER_CONFIGURE` (Deprecated since 2020-01)"]
1527 #[doc = "Mission command to configure a camera or antenna mount"]
1528 MAV_CMD_DO_MOUNT_CONFIGURE = 204,
1529 #[deprecated = "This message is ambiguous and inconsistent. It has been superseded by MAV_CMD_DO_GIMBAL_MANAGER_PITCHYAW and `MAV_CMD_DO_SET_ROI_*` variants. The message can still be used to communicate with legacy gimbals implementing it. See `MAV_CMD_DO_GIMBAL_MANAGER_PITCHYAW` (Deprecated since 2020-01)"]
1530 #[doc = "Mission command to control a camera or antenna mount"]
1531 MAV_CMD_DO_MOUNT_CONTROL = 205,
1532 #[doc = "Mission command to set camera trigger distance for this flight. The camera is triggered each time this distance is exceeded. This command can also be used to set the shutter integration time for the camera."]
1533 MAV_CMD_DO_SET_CAM_TRIGG_DIST = 206,
1534 #[doc = "Enable the geofence. This can be used in a mission or via the command protocol. The persistence/lifetime of the setting is undefined. Depending on flight stack implementation it may persist until superseded, or it may revert to a system default at the end of a mission. Flight stacks typically reset the setting to system defaults on reboot."]
1535 MAV_CMD_DO_FENCE_ENABLE = 207,
1536 #[doc = "Mission item/command to release a parachute or enable/disable auto release."]
1537 MAV_CMD_DO_PARACHUTE = 208,
1538 #[doc = "Command to perform motor test."]
1539 MAV_CMD_DO_MOTOR_TEST = 209,
1540 #[doc = "Change to/from inverted flight."]
1541 MAV_CMD_DO_INVERTED_FLIGHT = 210,
1542 #[doc = "Mission command to operate a gripper."]
1543 MAV_CMD_DO_GRIPPER = 211,
1544 #[doc = "Enable/disable autotune."]
1545 MAV_CMD_DO_AUTOTUNE_ENABLE = 212,
1546 #[doc = "Sets a desired vehicle turn angle and speed change."]
1547 MAV_CMD_NAV_SET_YAW_SPEED = 213,
1548 #[doc = "Mission command to set camera trigger interval for this flight. If triggering is enabled, the camera is triggered each time this interval expires. This command can also be used to set the shutter integration time for the camera."]
1549 MAV_CMD_DO_SET_CAM_TRIGG_INTERVAL = 214,
1550 #[deprecated = " See `MAV_CMD_DO_GIMBAL_MANAGER_PITCHYAW` (Deprecated since 2020-01)"]
1551 #[doc = "Mission command to control a camera or antenna mount, using a quaternion as reference."]
1552 MAV_CMD_DO_MOUNT_CONTROL_QUAT = 220,
1553 #[doc = "set id of master controller"]
1554 MAV_CMD_DO_GUIDED_MASTER = 221,
1555 #[doc = "Set limits for external control"]
1556 MAV_CMD_DO_GUIDED_LIMITS = 222,
1557 #[doc = "Control vehicle engine. This is interpreted by the vehicles engine controller to change the target engine state. It is intended for vehicles with internal combustion engines"]
1558 MAV_CMD_DO_ENGINE_CONTROL = 223,
1559 #[doc = "Set the mission item with sequence number seq as the current item and emit MISSION_CURRENT (whether or not the mission number changed). If a mission is currently being executed, the system will continue to this new mission item on the shortest path, skipping any intermediate mission items. \t Note that mission jump repeat counters are not reset unless param2 is set (see MAV_CMD_DO_JUMP param2). This command may trigger a mission state-machine change on some systems: for example from MISSION_STATE_NOT_STARTED or MISSION_STATE_PAUSED to MISSION_STATE_ACTIVE. If the system is in mission mode, on those systems this command might therefore start, restart or resume the mission. If the system is not in mission mode this command must not trigger a switch to mission mode. The mission may be \"reset\" using param2. Resetting sets jump counters to initial values (to reset counters without changing the current mission item set the param1 to `-1`). Resetting also explicitly changes a mission state of MISSION_STATE_COMPLETE to MISSION_STATE_PAUSED or MISSION_STATE_ACTIVE, potentially allowing it to resume when it is (next) in a mission mode. \t The command will ACK with MAV_RESULT_FAILED if the sequence number is out of range (including if there is no mission item)."]
1560 MAV_CMD_DO_SET_MISSION_CURRENT = 224,
1561 #[doc = "NOP - This command is only used to mark the upper limit of the DO commands in the enumeration"]
1562 MAV_CMD_DO_LAST = 240,
1563 #[doc = "Trigger calibration. This command will be only accepted if in pre-flight mode. Except for Temperature Calibration, only one sensor should be set in a single message and all others should be zero."]
1564 MAV_CMD_PREFLIGHT_CALIBRATION = 241,
1565 #[doc = "Set sensor offsets. This command will be only accepted if in pre-flight mode."]
1566 MAV_CMD_PREFLIGHT_SET_SENSOR_OFFSETS = 242,
1567 #[doc = "Trigger UAVCAN configuration (actuator ID assignment and direction mapping). Note that this maps to the legacy UAVCAN v0 function UAVCAN_ENUMERATE, which is intended to be executed just once during initial vehicle configuration (it is not a normal pre-flight command and has been poorly named)."]
1568 MAV_CMD_PREFLIGHT_UAVCAN = 243,
1569 #[doc = "Request storage of different parameter values and logs. This command will be only accepted if in pre-flight mode."]
1570 MAV_CMD_PREFLIGHT_STORAGE = 245,
1571 #[doc = "Request the reboot or shutdown of system components."]
1572 MAV_CMD_PREFLIGHT_REBOOT_SHUTDOWN = 246,
1573 #[doc = "Override current mission with command to pause mission, pause mission and move to position, continue/resume mission. When param 1 indicates that the mission is paused (MAV_GOTO_DO_HOLD), param 2 defines whether it holds in place or moves to another position."]
1574 MAV_CMD_OVERRIDE_GOTO = 252,
1575 #[doc = "Mission command to set a Camera Auto Mount Pivoting Oblique Survey (Replaces CAM_TRIGG_DIST for this purpose). The camera is triggered each time this distance is exceeded, then the mount moves to the next position. Params 4~6 set-up the angle limits and number of positions for oblique survey, where mount-enabled vehicles automatically roll the camera between shots to emulate an oblique camera setup (providing an increased HFOV). This command can also be used to set the shutter integration time for the camera."]
1576 MAV_CMD_OBLIQUE_SURVEY = 260,
1577 #[doc = "Enable the specified standard MAVLink mode. If the specified mode is not supported, the vehicle should ACK with MAV_RESULT_FAILED. See <https://mavlink.io/en/services/standard_modes.html>"]
1578 MAV_CMD_DO_SET_STANDARD_MODE = 262,
1579 #[doc = "start running a mission"]
1580 MAV_CMD_MISSION_START = 300,
1581 #[doc = "Actuator testing command. This is similar to MAV_CMD_DO_MOTOR_TEST but operates on the level of output functions, i.e. it is possible to test Motor1 independent from which output it is configured on. Autopilots must NACK this command with MAV_RESULT_TEMPORARILY_REJECTED while armed."]
1582 MAV_CMD_ACTUATOR_TEST = 310,
1583 #[doc = "Actuator configuration command."]
1584 MAV_CMD_CONFIGURE_ACTUATOR = 311,
1585 #[doc = "Arms / Disarms a component"]
1586 MAV_CMD_COMPONENT_ARM_DISARM = 400,
1587 #[doc = "Instructs a target system to run pre-arm checks. This allows preflight checks to be run on demand, which may be useful on systems that normally run them at low rate, or which do not trigger checks when the armable state might have changed. This command should return MAV_RESULT_ACCEPTED if it will run the checks. The results of the checks are usually then reported in SYS_STATUS messages (this is system-specific). The command should return MAV_RESULT_TEMPORARILY_REJECTED if the system is already armed."]
1588 MAV_CMD_RUN_PREARM_CHECKS = 401,
1589 #[doc = "Turns illuminators ON/OFF. An illuminator is a light source that is used for lighting up dark areas external to the system: e.g. a torch or searchlight (as opposed to a light source for illuminating the system itself, e.g. an indicator light)."]
1590 MAV_CMD_ILLUMINATOR_ON_OFF = 405,
1591 #[doc = "Configures illuminator settings. An illuminator is a light source that is used for lighting up dark areas external to the system: e.g. a torch or searchlight (as opposed to a light source for illuminating the system itself, e.g. an indicator light)."]
1592 MAV_CMD_DO_ILLUMINATOR_CONFIGURE = 406,
1593 #[deprecated = " See `MAV_CMD_REQUEST_MESSAGE` (Deprecated since 2022-04)"]
1594 #[doc = "Request the home position from the vehicle. \t The vehicle will ACK the command and then emit the HOME_POSITION message."]
1595 MAV_CMD_GET_HOME_POSITION = 410,
1596 #[doc = "Inject artificial failure for testing purposes. Note that autopilots should implement an additional protection before accepting this command such as a specific param setting."]
1597 MAV_CMD_INJECT_FAILURE = 420,
1598 #[doc = "Starts receiver pairing."]
1599 MAV_CMD_START_RX_PAIR = 500,
1600 #[deprecated = " See `MAV_CMD_REQUEST_MESSAGE` (Deprecated since 2022-04)"]
1601 #[doc = "Request the interval between messages for a particular MAVLink message ID. The receiver should ACK the command and then emit its response in a MESSAGE_INTERVAL message."]
1602 MAV_CMD_GET_MESSAGE_INTERVAL = 510,
1603 #[doc = "Set the interval between messages for a particular MAVLink message ID. This interface replaces REQUEST_DATA_STREAM."]
1604 MAV_CMD_SET_MESSAGE_INTERVAL = 511,
1605 #[doc = "Request the target system(s) emit a single instance of a specified message (i.e. a \"one-shot\" version of MAV_CMD_SET_MESSAGE_INTERVAL)."]
1606 MAV_CMD_REQUEST_MESSAGE = 512,
1607 #[deprecated = " See `MAV_CMD_REQUEST_MESSAGE` (Deprecated since 2019-08)"]
1608 #[doc = "Request MAVLink protocol version compatibility. All receivers should ACK the command and then emit their capabilities in an PROTOCOL_VERSION message"]
1609 MAV_CMD_REQUEST_PROTOCOL_VERSION = 519,
1610 #[deprecated = " See `MAV_CMD_REQUEST_MESSAGE` (Deprecated since 2019-08)"]
1611 #[doc = "Request autopilot capabilities. The receiver should ACK the command and then emit its capabilities in an AUTOPILOT_VERSION message"]
1612 MAV_CMD_REQUEST_AUTOPILOT_CAPABILITIES = 520,
1613 #[deprecated = " See `MAV_CMD_REQUEST_MESSAGE` (Deprecated since 2019-08)"]
1614 #[doc = "Request camera information (CAMERA_INFORMATION)."]
1615 MAV_CMD_REQUEST_CAMERA_INFORMATION = 521,
1616 #[deprecated = " See `MAV_CMD_REQUEST_MESSAGE` (Deprecated since 2019-08)"]
1617 #[doc = "Request camera settings (CAMERA_SETTINGS)."]
1618 MAV_CMD_REQUEST_CAMERA_SETTINGS = 522,
1619 #[deprecated = " See `MAV_CMD_REQUEST_MESSAGE` (Deprecated since 2019-08)"]
1620 #[doc = "Request storage information (STORAGE_INFORMATION). Use the command's target_component to target a specific component's storage."]
1621 MAV_CMD_REQUEST_STORAGE_INFORMATION = 525,
1622 #[doc = "Format a storage medium. Once format is complete, a STORAGE_INFORMATION message is sent. Use the command's target_component to target a specific component's storage."]
1623 MAV_CMD_STORAGE_FORMAT = 526,
1624 #[deprecated = " See `MAV_CMD_REQUEST_MESSAGE` (Deprecated since 2019-08)"]
1625 #[doc = "Request camera capture status (CAMERA_CAPTURE_STATUS)"]
1626 MAV_CMD_REQUEST_CAMERA_CAPTURE_STATUS = 527,
1627 #[deprecated = " See `MAV_CMD_REQUEST_MESSAGE` (Deprecated since 2019-08)"]
1628 #[doc = "Request flight information (FLIGHT_INFORMATION)"]
1629 MAV_CMD_REQUEST_FLIGHT_INFORMATION = 528,
1630 #[doc = "Reset all camera settings to Factory Default"]
1631 MAV_CMD_RESET_CAMERA_SETTINGS = 529,
1632 #[doc = "Set camera running mode. Use NaN for reserved values. GCS will send a MAV_CMD_REQUEST_VIDEO_STREAM_STATUS command after a mode change if the camera supports video streaming."]
1633 MAV_CMD_SET_CAMERA_MODE = 530,
1634 #[doc = "Set camera zoom. Camera must respond with a CAMERA_SETTINGS message (on success)."]
1635 MAV_CMD_SET_CAMERA_ZOOM = 531,
1636 #[doc = "Set camera focus. Camera must respond with a CAMERA_SETTINGS message (on success)."]
1637 MAV_CMD_SET_CAMERA_FOCUS = 532,
1638 #[doc = "Set that a particular storage is the preferred location for saving photos, videos, and/or other media (e.g. to set that an SD card is used for storing videos). There can only be one preferred save location for each particular media type: setting a media usage flag will clear/reset that same flag if set on any other storage. If no flag is set the system should use its default storage. A target system can choose to always use default storage, in which case it should ACK the command with MAV_RESULT_UNSUPPORTED. A target system can choose to not allow a particular storage to be set as preferred storage, in which case it should ACK the command with MAV_RESULT_DENIED."]
1639 MAV_CMD_SET_STORAGE_USAGE = 533,
1640 #[doc = "Set camera source. Changes the camera's active sources on cameras with multiple image sensors."]
1641 MAV_CMD_SET_CAMERA_SOURCE = 534,
1642 #[doc = "Tagged jump target. Can be jumped to with MAV_CMD_DO_JUMP_TAG."]
1643 MAV_CMD_JUMP_TAG = 600,
1644 #[doc = "Jump to the matching tag in the mission list. Repeat this action for the specified number of times. A mission should contain a single matching tag for each jump. If this is not the case then a jump to a missing tag should complete the mission, and a jump where there are multiple matching tags should always select the one with the lowest mission sequence number."]
1645 MAV_CMD_DO_JUMP_TAG = 601,
1646 #[doc = "Set gimbal manager pitch/yaw setpoints (low rate command). It is possible to set combinations of the values below. E.g. an angle as well as a desired angular rate can be used to get to this angle at a certain angular rate, or an angular rate only will result in continuous turning. NaN is to be used to signal unset. Note: only the gimbal manager will react to this command - it will be ignored by a gimbal device. Use GIMBAL_MANAGER_SET_PITCHYAW if you need to stream pitch/yaw setpoints at higher rate."]
1647 MAV_CMD_DO_GIMBAL_MANAGER_PITCHYAW = 1000,
1648 #[doc = "Gimbal configuration to set which sysid/compid is in primary and secondary control."]
1649 MAV_CMD_DO_GIMBAL_MANAGER_CONFIGURE = 1001,
1650 #[doc = "Start image capture sequence. CAMERA_IMAGE_CAPTURED must be emitted after each capture. Param1 (id) may be used to specify the target camera: 0: all cameras, 1 to 6: autopilot-connected cameras, 7-255: MAVLink camera component ID. It is needed in order to target specific cameras connected to the autopilot, or specific sensors in a multi-sensor camera (neither of which have a distinct MAVLink component ID). It is also needed to specify the target camera in missions. When used in a mission, an autopilot should execute the MAV_CMD for a specified local camera (param1 = 1-6), or resend it as a command if it is intended for a MAVLink camera (param1 = 7 - 255), setting the command's target_component as the param1 value (and setting param1 in the command to zero). If the param1 is 0 the autopilot should do both. When sent in a command the target MAVLink address is set using target_component. If addressed specifically to an autopilot: param1 should be used in the same way as it is for missions (though command should NACK with MAV_RESULT_DENIED if a specified local camera does not exist). If addressed to a MAVLink camera, param 1 can be used to address all cameras (0), or to separately address 1 to 7 individual sensors. Other values should be NACKed with MAV_RESULT_DENIED. If the command is broadcast (target_component is 0) then param 1 should be set to 0 (any other value should be NACKED with MAV_RESULT_DENIED). An autopilot would trigger any local cameras and forward the command to all channels."]
1651 MAV_CMD_IMAGE_START_CAPTURE = 2000,
1652 #[doc = "Stop image capture sequence. Param1 (id) may be used to specify the target camera: 0: all cameras, 1 to 6: autopilot-connected cameras, 7-255: MAVLink camera component ID. It is needed in order to target specific cameras connected to the autopilot, or specific sensors in a multi-sensor camera (neither of which have a distinct MAVLink component ID). It is also needed to specify the target camera in missions. When used in a mission, an autopilot should execute the MAV_CMD for a specified local camera (param1 = 1-6), or resend it as a command if it is intended for a MAVLink camera (param1 = 7 - 255), setting the command's target_component as the param1 value (and setting param1 in the command to zero). If the param1 is 0 the autopilot should do both. When sent in a command the target MAVLink address is set using target_component. If addressed specifically to an autopilot: param1 should be used in the same way as it is for missions (though command should NACK with MAV_RESULT_DENIED if a specified local camera does not exist). If addressed to a MAVLink camera, param1 can be used to address all cameras (0), or to separately address 1 to 7 individual sensors. Other values should be NACKed with MAV_RESULT_DENIED. If the command is broadcast (target_component is 0) then param 1 should be set to 0 (any other value should be NACKED with MAV_RESULT_DENIED). An autopilot would trigger any local cameras and forward the command to all channels."]
1653 MAV_CMD_IMAGE_STOP_CAPTURE = 2001,
1654 #[deprecated = " See `MAV_CMD_REQUEST_MESSAGE` (Deprecated since 2019-08)"]
1655 #[doc = "Re-request a CAMERA_IMAGE_CAPTURED message."]
1656 MAV_CMD_REQUEST_CAMERA_IMAGE_CAPTURE = 2002,
1657 #[doc = "Enable or disable on-board camera triggering system."]
1658 MAV_CMD_DO_TRIGGER_CONTROL = 2003,
1659 #[doc = "If the camera supports point visual tracking (CAMERA_CAP_FLAGS_HAS_TRACKING_POINT is set), this command allows to initiate the tracking."]
1660 MAV_CMD_CAMERA_TRACK_POINT = 2004,
1661 #[doc = "If the camera supports rectangle visual tracking (CAMERA_CAP_FLAGS_HAS_TRACKING_RECTANGLE is set), this command allows to initiate the tracking."]
1662 MAV_CMD_CAMERA_TRACK_RECTANGLE = 2005,
1663 #[doc = "Stops ongoing tracking."]
1664 MAV_CMD_CAMERA_STOP_TRACKING = 2010,
1665 #[doc = "Starts video capture (recording)."]
1666 MAV_CMD_VIDEO_START_CAPTURE = 2500,
1667 #[doc = "Stop the current video capture (recording)."]
1668 MAV_CMD_VIDEO_STOP_CAPTURE = 2501,
1669 #[doc = "Start video streaming"]
1670 MAV_CMD_VIDEO_START_STREAMING = 2502,
1671 #[doc = "Stop the given video stream"]
1672 MAV_CMD_VIDEO_STOP_STREAMING = 2503,
1673 #[deprecated = " See `MAV_CMD_REQUEST_MESSAGE` (Deprecated since 2019-08)"]
1674 #[doc = "Request video stream information (VIDEO_STREAM_INFORMATION)"]
1675 MAV_CMD_REQUEST_VIDEO_STREAM_INFORMATION = 2504,
1676 #[deprecated = " See `MAV_CMD_REQUEST_MESSAGE` (Deprecated since 2019-08)"]
1677 #[doc = "Request video stream status (VIDEO_STREAM_STATUS)"]
1678 MAV_CMD_REQUEST_VIDEO_STREAM_STATUS = 2505,
1679 #[doc = "Request to start streaming logging data over MAVLink (see also LOGGING_DATA message)"]
1680 MAV_CMD_LOGGING_START = 2510,
1681 #[doc = "Request to stop streaming log data over MAVLink"]
1682 MAV_CMD_LOGGING_STOP = 2511,
1683 MAV_CMD_AIRFRAME_CONFIGURATION = 2520,
1684 #[doc = "Request to start/stop transmitting over the high latency telemetry"]
1685 MAV_CMD_CONTROL_HIGH_LATENCY = 2600,
1686 #[doc = "Create a panorama at the current position"]
1687 MAV_CMD_PANORAMA_CREATE = 2800,
1688 #[doc = "Request VTOL transition"]
1689 MAV_CMD_DO_VTOL_TRANSITION = 3000,
1690 #[doc = "Request authorization to arm the vehicle to a external entity, the arm authorizer is responsible to request all data that is needs from the vehicle before authorize or deny the request. \t\tIf approved the COMMAND_ACK message progress field should be set with period of time that this authorization is valid in seconds. \t\tIf the authorization is denied COMMAND_ACK.result_param2 should be set with one of the reasons in ARM_AUTH_DENIED_REASON."]
1691 MAV_CMD_ARM_AUTHORIZATION_REQUEST = 3001,
1692 #[doc = "This command sets the submode to standard guided when vehicle is in guided mode. The vehicle holds position and altitude and the user can input the desired velocities along all three axes."]
1693 MAV_CMD_SET_GUIDED_SUBMODE_STANDARD = 4000,
1694 #[doc = "This command sets submode circle when vehicle is in guided mode. Vehicle flies along a circle facing the center of the circle. The user can input the velocity along the circle and change the radius. If no input is given the vehicle will hold position."]
1695 MAV_CMD_SET_GUIDED_SUBMODE_CIRCLE = 4001,
1696 #[doc = "Delay mission state machine until gate has been reached."]
1697 MAV_CMD_CONDITION_GATE = 4501,
1698 #[doc = "Fence return point (there can only be one such point in a geofence definition). If rally points are supported they should be used instead."]
1699 MAV_CMD_NAV_FENCE_RETURN_POINT = 5000,
1700 #[doc = "Fence vertex for an inclusion polygon (the polygon must not be self-intersecting). The vehicle must stay within this area. Minimum of 3 vertices required. The vertices for a polygon must be sent sequentially, each with param1 set to the total number of vertices in the polygon."]
1701 MAV_CMD_NAV_FENCE_POLYGON_VERTEX_INCLUSION = 5001,
1702 #[doc = "Fence vertex for an exclusion polygon (the polygon must not be self-intersecting). The vehicle must stay outside this area. Minimum of 3 vertices required. The vertices for a polygon must be sent sequentially, each with param1 set to the total number of vertices in the polygon."]
1703 MAV_CMD_NAV_FENCE_POLYGON_VERTEX_EXCLUSION = 5002,
1704 #[doc = "Circular fence area. The vehicle must stay inside this area."]
1705 MAV_CMD_NAV_FENCE_CIRCLE_INCLUSION = 5003,
1706 #[doc = "Circular fence area. The vehicle must stay outside this area."]
1707 MAV_CMD_NAV_FENCE_CIRCLE_EXCLUSION = 5004,
1708 #[doc = "Rally point. You can have multiple rally points defined."]
1709 MAV_CMD_NAV_RALLY_POINT = 5100,
1710 #[doc = "Commands the vehicle to respond with a sequence of messages UAVCAN_NODE_INFO, one message per every UAVCAN node that is online. Note that some of the response messages can be lost, which the receiver can detect easily by checking whether every received UAVCAN_NODE_STATUS has a matching message UAVCAN_NODE_INFO received earlier; if not, this command should be sent again in order to request re-transmission of the node information messages."]
1711 MAV_CMD_UAVCAN_GET_NODE_INFO = 5200,
1712 #[doc = "Change state of safety switch."]
1713 MAV_CMD_DO_SET_SAFETY_SWITCH_STATE = 5300,
1714 #[doc = "Trigger the start of an ADSB-out IDENT. This should only be used when requested to do so by an Air Traffic Controller in controlled airspace. This starts the IDENT which is then typically held for 18 seconds by the hardware per the Mode A, C, and S transponder spec."]
1715 MAV_CMD_DO_ADSB_OUT_IDENT = 10001,
1716 #[deprecated = " (Deprecated since 2021-06)"]
1717 #[doc = "Deploy payload on a Lat / Lon / Alt position. This includes the navigation to reach the required release position and velocity."]
1718 MAV_CMD_PAYLOAD_PREPARE_DEPLOY = 30001,
1719 #[deprecated = " (Deprecated since 2021-06)"]
1720 #[doc = "Control the payload deployment."]
1721 MAV_CMD_PAYLOAD_CONTROL_DEPLOY = 30002,
1722 #[doc = "Magnetometer calibration based on provided known yaw. This allows for fast calibration using WMM field tables in the vehicle, given only the known yaw of the vehicle. If Latitude and longitude are both zero then use the current vehicle location."]
1723 MAV_CMD_FIXED_MAG_CAL_YAW = 42006,
1724 #[doc = "Command to operate winch."]
1725 MAV_CMD_DO_WINCH = 42600,
1726 #[doc = "Provide an external position estimate for use when dead-reckoning. This is meant to be used for occasional position resets that may be provided by a external system such as a remote pilot using landmarks over a video link."]
1727 MAV_CMD_EXTERNAL_POSITION_ESTIMATE = 43003,
1728 #[doc = "User defined waypoint item. Ground Station will show the Vehicle as flying through this item."]
1729 MAV_CMD_WAYPOINT_USER_1 = 31000,
1730 #[doc = "User defined waypoint item. Ground Station will show the Vehicle as flying through this item."]
1731 MAV_CMD_WAYPOINT_USER_2 = 31001,
1732 #[doc = "User defined waypoint item. Ground Station will show the Vehicle as flying through this item."]
1733 MAV_CMD_WAYPOINT_USER_3 = 31002,
1734 #[doc = "User defined waypoint item. Ground Station will show the Vehicle as flying through this item."]
1735 MAV_CMD_WAYPOINT_USER_4 = 31003,
1736 #[doc = "User defined waypoint item. Ground Station will show the Vehicle as flying through this item."]
1737 MAV_CMD_WAYPOINT_USER_5 = 31004,
1738 #[doc = "User defined spatial item. Ground Station will not show the Vehicle as flying through this item. Example: ROI item."]
1739 MAV_CMD_SPATIAL_USER_1 = 31005,
1740 #[doc = "User defined spatial item. Ground Station will not show the Vehicle as flying through this item. Example: ROI item."]
1741 MAV_CMD_SPATIAL_USER_2 = 31006,
1742 #[doc = "User defined spatial item. Ground Station will not show the Vehicle as flying through this item. Example: ROI item."]
1743 MAV_CMD_SPATIAL_USER_3 = 31007,
1744 #[doc = "User defined spatial item. Ground Station will not show the Vehicle as flying through this item. Example: ROI item."]
1745 MAV_CMD_SPATIAL_USER_4 = 31008,
1746 #[doc = "User defined spatial item. Ground Station will not show the Vehicle as flying through this item. Example: ROI item."]
1747 MAV_CMD_SPATIAL_USER_5 = 31009,
1748 #[doc = "User defined command. Ground Station will not show the Vehicle as flying through this item. Example: MAV_CMD_DO_SET_PARAMETER item."]
1749 MAV_CMD_USER_1 = 31010,
1750 #[doc = "User defined command. Ground Station will not show the Vehicle as flying through this item. Example: MAV_CMD_DO_SET_PARAMETER item."]
1751 MAV_CMD_USER_2 = 31011,
1752 #[doc = "User defined command. Ground Station will not show the Vehicle as flying through this item. Example: MAV_CMD_DO_SET_PARAMETER item."]
1753 MAV_CMD_USER_3 = 31012,
1754 #[doc = "User defined command. Ground Station will not show the Vehicle as flying through this item. Example: MAV_CMD_DO_SET_PARAMETER item."]
1755 MAV_CMD_USER_4 = 31013,
1756 #[doc = "User defined command. Ground Station will not show the Vehicle as flying through this item. Example: MAV_CMD_DO_SET_PARAMETER item."]
1757 MAV_CMD_USER_5 = 31014,
1758 #[doc = "Request forwarding of CAN packets from the given CAN bus to this component. CAN Frames are sent using CAN_FRAME and CANFD_FRAME messages"]
1759 MAV_CMD_CAN_FORWARD = 32000,
1760 #[doc = "AVSS defined command. Set PRS arm statuses."]
1761 MAV_CMD_PRS_SET_ARM = 60050,
1762 #[doc = "AVSS defined command. Gets PRS arm statuses"]
1763 MAV_CMD_PRS_GET_ARM = 60051,
1764 #[doc = "AVSS defined command. Get the PRS battery voltage in millivolts"]
1765 MAV_CMD_PRS_GET_BATTERY = 60052,
1766 #[doc = "AVSS defined command. Get the PRS error statuses."]
1767 MAV_CMD_PRS_GET_ERR = 60053,
1768 #[doc = "AVSS defined command. Set the ATS arming altitude in meters."]
1769 MAV_CMD_PRS_SET_ARM_ALTI = 60070,
1770 #[doc = "AVSS defined command. Get the ATS arming altitude in meters."]
1771 MAV_CMD_PRS_GET_ARM_ALTI = 60071,
1772 #[doc = "AVSS defined command. Shuts down the PRS system."]
1773 MAV_CMD_PRS_SHUTDOWN = 60072,
1774}
1775impl MavCmd {
1776 pub const DEFAULT: Self = Self::MAV_CMD_NAV_WAYPOINT;
1777}
1778impl Default for MavCmd {
1779 fn default() -> Self {
1780 Self::DEFAULT
1781 }
1782}
1783#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1784#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1785#[cfg_attr(feature = "serde", serde(tag = "type"))]
1786#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1787#[repr(u32)]
1788#[doc = "Possible actions an aircraft can take to avoid a collision."]
1789pub enum MavCollisionAction {
1790 #[doc = "Ignore any potential collisions"]
1791 MAV_COLLISION_ACTION_NONE = 0,
1792 #[doc = "Report potential collision"]
1793 MAV_COLLISION_ACTION_REPORT = 1,
1794 #[doc = "Ascend or Descend to avoid threat"]
1795 MAV_COLLISION_ACTION_ASCEND_OR_DESCEND = 2,
1796 #[doc = "Move horizontally to avoid threat"]
1797 MAV_COLLISION_ACTION_MOVE_HORIZONTALLY = 3,
1798 #[doc = "Aircraft to move perpendicular to the collision's velocity vector"]
1799 MAV_COLLISION_ACTION_MOVE_PERPENDICULAR = 4,
1800 #[doc = "Aircraft to fly directly back to its launch point"]
1801 MAV_COLLISION_ACTION_RTL = 5,
1802 #[doc = "Aircraft to stop in place"]
1803 MAV_COLLISION_ACTION_HOVER = 6,
1804}
1805impl MavCollisionAction {
1806 pub const DEFAULT: Self = Self::MAV_COLLISION_ACTION_NONE;
1807}
1808impl Default for MavCollisionAction {
1809 fn default() -> Self {
1810 Self::DEFAULT
1811 }
1812}
1813#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1814#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1815#[cfg_attr(feature = "serde", serde(tag = "type"))]
1816#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1817#[repr(u32)]
1818#[doc = "Source of information about this collision."]
1819pub enum MavCollisionSrc {
1820 #[doc = "ID field references ADSB_VEHICLE packets"]
1821 MAV_COLLISION_SRC_ADSB = 0,
1822 #[doc = "ID field references MAVLink SRC ID"]
1823 MAV_COLLISION_SRC_MAVLINK_GPS_GLOBAL_INT = 1,
1824}
1825impl MavCollisionSrc {
1826 pub const DEFAULT: Self = Self::MAV_COLLISION_SRC_ADSB;
1827}
1828impl Default for MavCollisionSrc {
1829 fn default() -> Self {
1830 Self::DEFAULT
1831 }
1832}
1833#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1834#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1835#[cfg_attr(feature = "serde", serde(tag = "type"))]
1836#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1837#[repr(u32)]
1838#[doc = "Aircraft-rated danger from this threat."]
1839pub enum MavCollisionThreatLevel {
1840 #[doc = "Not a threat"]
1841 MAV_COLLISION_THREAT_LEVEL_NONE = 0,
1842 #[doc = "Craft is mildly concerned about this threat"]
1843 MAV_COLLISION_THREAT_LEVEL_LOW = 1,
1844 #[doc = "Craft is panicking, and may take actions to avoid threat"]
1845 MAV_COLLISION_THREAT_LEVEL_HIGH = 2,
1846}
1847impl MavCollisionThreatLevel {
1848 pub const DEFAULT: Self = Self::MAV_COLLISION_THREAT_LEVEL_NONE;
1849}
1850impl Default for MavCollisionThreatLevel {
1851 fn default() -> Self {
1852 Self::DEFAULT
1853 }
1854}
1855#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
1856#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
1857#[cfg_attr(feature = "serde", serde(tag = "type"))]
1858#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
1859#[repr(u32)]
1860#[doc = "Component ids (values) for the different types and instances of onboard hardware/software that might make up a MAVLink system (autopilot, cameras, servos, GPS systems, avoidance systems etc.). Components must use the appropriate ID in their source address when sending messages. Components can also use IDs to determine if they are the intended recipient of an incoming message. The MAV_COMP_ID_ALL value is used to indicate messages that must be processed by all components. When creating new entries, components that can have multiple instances (e.g. cameras, servos etc.) should be allocated sequential values. An appropriate number of values should be left free after these components to allow the number of instances to be expanded."]
1861pub enum MavComponent {
1862 #[doc = "Target id (target_component) used to broadcast messages to all components of the receiving system. Components should attempt to process messages with this component ID and forward to components on any other interfaces. Note: This is not a valid *source* component id for a message."]
1863 MAV_COMP_ID_ALL = 0,
1864 #[doc = "System flight controller component (\"autopilot\"). Only one autopilot is expected in a particular system."]
1865 MAV_COMP_ID_AUTOPILOT1 = 1,
1866 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1867 MAV_COMP_ID_USER1 = 25,
1868 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1869 MAV_COMP_ID_USER2 = 26,
1870 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1871 MAV_COMP_ID_USER3 = 27,
1872 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1873 MAV_COMP_ID_USER4 = 28,
1874 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1875 MAV_COMP_ID_USER5 = 29,
1876 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1877 MAV_COMP_ID_USER6 = 30,
1878 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1879 MAV_COMP_ID_USER7 = 31,
1880 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1881 MAV_COMP_ID_USER8 = 32,
1882 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1883 MAV_COMP_ID_USER9 = 33,
1884 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1885 MAV_COMP_ID_USER10 = 34,
1886 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1887 MAV_COMP_ID_USER11 = 35,
1888 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1889 MAV_COMP_ID_USER12 = 36,
1890 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1891 MAV_COMP_ID_USER13 = 37,
1892 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1893 MAV_COMP_ID_USER14 = 38,
1894 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1895 MAV_COMP_ID_USER15 = 39,
1896 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1897 MAV_COMP_ID_USER16 = 40,
1898 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1899 MAV_COMP_ID_USER17 = 41,
1900 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1901 MAV_COMP_ID_USER18 = 42,
1902 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1903 MAV_COMP_ID_USER19 = 43,
1904 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1905 MAV_COMP_ID_USER20 = 44,
1906 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1907 MAV_COMP_ID_USER21 = 45,
1908 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1909 MAV_COMP_ID_USER22 = 46,
1910 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1911 MAV_COMP_ID_USER23 = 47,
1912 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1913 MAV_COMP_ID_USER24 = 48,
1914 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1915 MAV_COMP_ID_USER25 = 49,
1916 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1917 MAV_COMP_ID_USER26 = 50,
1918 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1919 MAV_COMP_ID_USER27 = 51,
1920 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1921 MAV_COMP_ID_USER28 = 52,
1922 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1923 MAV_COMP_ID_USER29 = 53,
1924 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1925 MAV_COMP_ID_USER30 = 54,
1926 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1927 MAV_COMP_ID_USER31 = 55,
1928 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1929 MAV_COMP_ID_USER32 = 56,
1930 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1931 MAV_COMP_ID_USER33 = 57,
1932 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1933 MAV_COMP_ID_USER34 = 58,
1934 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1935 MAV_COMP_ID_USER35 = 59,
1936 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1937 MAV_COMP_ID_USER36 = 60,
1938 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1939 MAV_COMP_ID_USER37 = 61,
1940 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1941 MAV_COMP_ID_USER38 = 62,
1942 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1943 MAV_COMP_ID_USER39 = 63,
1944 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1945 MAV_COMP_ID_USER40 = 64,
1946 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1947 MAV_COMP_ID_USER41 = 65,
1948 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1949 MAV_COMP_ID_USER42 = 66,
1950 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1951 MAV_COMP_ID_USER43 = 67,
1952 #[doc = "Telemetry radio (e.g. SiK radio, or other component that emits RADIO_STATUS messages)."]
1953 MAV_COMP_ID_TELEMETRY_RADIO = 68,
1954 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1955 MAV_COMP_ID_USER45 = 69,
1956 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1957 MAV_COMP_ID_USER46 = 70,
1958 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1959 MAV_COMP_ID_USER47 = 71,
1960 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1961 MAV_COMP_ID_USER48 = 72,
1962 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1963 MAV_COMP_ID_USER49 = 73,
1964 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1965 MAV_COMP_ID_USER50 = 74,
1966 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1967 MAV_COMP_ID_USER51 = 75,
1968 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1969 MAV_COMP_ID_USER52 = 76,
1970 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1971 MAV_COMP_ID_USER53 = 77,
1972 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1973 MAV_COMP_ID_USER54 = 78,
1974 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1975 MAV_COMP_ID_USER55 = 79,
1976 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1977 MAV_COMP_ID_USER56 = 80,
1978 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1979 MAV_COMP_ID_USER57 = 81,
1980 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1981 MAV_COMP_ID_USER58 = 82,
1982 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1983 MAV_COMP_ID_USER59 = 83,
1984 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1985 MAV_COMP_ID_USER60 = 84,
1986 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1987 MAV_COMP_ID_USER61 = 85,
1988 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1989 MAV_COMP_ID_USER62 = 86,
1990 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1991 MAV_COMP_ID_USER63 = 87,
1992 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1993 MAV_COMP_ID_USER64 = 88,
1994 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1995 MAV_COMP_ID_USER65 = 89,
1996 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1997 MAV_COMP_ID_USER66 = 90,
1998 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
1999 MAV_COMP_ID_USER67 = 91,
2000 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
2001 MAV_COMP_ID_USER68 = 92,
2002 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
2003 MAV_COMP_ID_USER69 = 93,
2004 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
2005 MAV_COMP_ID_USER70 = 94,
2006 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
2007 MAV_COMP_ID_USER71 = 95,
2008 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
2009 MAV_COMP_ID_USER72 = 96,
2010 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
2011 MAV_COMP_ID_USER73 = 97,
2012 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
2013 MAV_COMP_ID_USER74 = 98,
2014 #[doc = "Id for a component on privately managed MAVLink network. Can be used for any purpose but may not be published by components outside of the private network."]
2015 MAV_COMP_ID_USER75 = 99,
2016 #[doc = "Camera #1."]
2017 MAV_COMP_ID_CAMERA = 100,
2018 #[doc = "Camera #2."]
2019 MAV_COMP_ID_CAMERA2 = 101,
2020 #[doc = "Camera #3."]
2021 MAV_COMP_ID_CAMERA3 = 102,
2022 #[doc = "Camera #4."]
2023 MAV_COMP_ID_CAMERA4 = 103,
2024 #[doc = "Camera #5."]
2025 MAV_COMP_ID_CAMERA5 = 104,
2026 #[doc = "Camera #6."]
2027 MAV_COMP_ID_CAMERA6 = 105,
2028 #[doc = "Servo #1."]
2029 MAV_COMP_ID_SERVO1 = 140,
2030 #[doc = "Servo #2."]
2031 MAV_COMP_ID_SERVO2 = 141,
2032 #[doc = "Servo #3."]
2033 MAV_COMP_ID_SERVO3 = 142,
2034 #[doc = "Servo #4."]
2035 MAV_COMP_ID_SERVO4 = 143,
2036 #[doc = "Servo #5."]
2037 MAV_COMP_ID_SERVO5 = 144,
2038 #[doc = "Servo #6."]
2039 MAV_COMP_ID_SERVO6 = 145,
2040 #[doc = "Servo #7."]
2041 MAV_COMP_ID_SERVO7 = 146,
2042 #[doc = "Servo #8."]
2043 MAV_COMP_ID_SERVO8 = 147,
2044 #[doc = "Servo #9."]
2045 MAV_COMP_ID_SERVO9 = 148,
2046 #[doc = "Servo #10."]
2047 MAV_COMP_ID_SERVO10 = 149,
2048 #[doc = "Servo #11."]
2049 MAV_COMP_ID_SERVO11 = 150,
2050 #[doc = "Servo #12."]
2051 MAV_COMP_ID_SERVO12 = 151,
2052 #[doc = "Servo #13."]
2053 MAV_COMP_ID_SERVO13 = 152,
2054 #[doc = "Servo #14."]
2055 MAV_COMP_ID_SERVO14 = 153,
2056 #[doc = "Gimbal #1."]
2057 MAV_COMP_ID_GIMBAL = 154,
2058 #[doc = "Logging component."]
2059 MAV_COMP_ID_LOG = 155,
2060 #[doc = "Automatic Dependent Surveillance-Broadcast (ADS-B) component."]
2061 MAV_COMP_ID_ADSB = 156,
2062 #[doc = "On Screen Display (OSD) devices for video links."]
2063 MAV_COMP_ID_OSD = 157,
2064 #[doc = "Generic autopilot peripheral component ID. Meant for devices that do not implement the parameter microservice."]
2065 MAV_COMP_ID_PERIPHERAL = 158,
2066 #[deprecated = "All gimbals should use MAV_COMP_ID_GIMBAL. See `MAV_COMP_ID_GIMBAL` (Deprecated since 2018-11)"]
2067 #[doc = "Gimbal ID for QX1."]
2068 MAV_COMP_ID_QX1_GIMBAL = 159,
2069 #[doc = "FLARM collision alert component."]
2070 MAV_COMP_ID_FLARM = 160,
2071 #[doc = "Parachute component."]
2072 MAV_COMP_ID_PARACHUTE = 161,
2073 #[doc = "Winch component."]
2074 MAV_COMP_ID_WINCH = 169,
2075 #[doc = "Gimbal #2."]
2076 MAV_COMP_ID_GIMBAL2 = 171,
2077 #[doc = "Gimbal #3."]
2078 MAV_COMP_ID_GIMBAL3 = 172,
2079 #[doc = "Gimbal #4"]
2080 MAV_COMP_ID_GIMBAL4 = 173,
2081 #[doc = "Gimbal #5."]
2082 MAV_COMP_ID_GIMBAL5 = 174,
2083 #[doc = "Gimbal #6."]
2084 MAV_COMP_ID_GIMBAL6 = 175,
2085 #[doc = "Battery #1."]
2086 MAV_COMP_ID_BATTERY = 180,
2087 #[doc = "Battery #2."]
2088 MAV_COMP_ID_BATTERY2 = 181,
2089 #[doc = "CAN over MAVLink client."]
2090 MAV_COMP_ID_MAVCAN = 189,
2091 #[doc = "Component that can generate/supply a mission flight plan (e.g. GCS or developer API)."]
2092 MAV_COMP_ID_MISSIONPLANNER = 190,
2093 #[doc = "Component that lives on the onboard computer (companion computer) and has some generic functionalities, such as settings system parameters and monitoring the status of some processes that don't directly speak mavlink and so on."]
2094 MAV_COMP_ID_ONBOARD_COMPUTER = 191,
2095 #[doc = "Component that lives on the onboard computer (companion computer) and has some generic functionalities, such as settings system parameters and monitoring the status of some processes that don't directly speak mavlink and so on."]
2096 MAV_COMP_ID_ONBOARD_COMPUTER2 = 192,
2097 #[doc = "Component that lives on the onboard computer (companion computer) and has some generic functionalities, such as settings system parameters and monitoring the status of some processes that don't directly speak mavlink and so on."]
2098 MAV_COMP_ID_ONBOARD_COMPUTER3 = 193,
2099 #[doc = "Component that lives on the onboard computer (companion computer) and has some generic functionalities, such as settings system parameters and monitoring the status of some processes that don't directly speak mavlink and so on."]
2100 MAV_COMP_ID_ONBOARD_COMPUTER4 = 194,
2101 #[doc = "Component that finds an optimal path between points based on a certain constraint (e.g. minimum snap, shortest path, cost, etc.)."]
2102 MAV_COMP_ID_PATHPLANNER = 195,
2103 #[doc = "Component that plans a collision free path between two points."]
2104 MAV_COMP_ID_OBSTACLE_AVOIDANCE = 196,
2105 #[doc = "Component that provides position estimates using VIO techniques."]
2106 MAV_COMP_ID_VISUAL_INERTIAL_ODOMETRY = 197,
2107 #[doc = "Component that manages pairing of vehicle and GCS."]
2108 MAV_COMP_ID_PAIRING_MANAGER = 198,
2109 #[doc = "Inertial Measurement Unit (IMU) #1."]
2110 MAV_COMP_ID_IMU = 200,
2111 #[doc = "Inertial Measurement Unit (IMU) #2."]
2112 MAV_COMP_ID_IMU_2 = 201,
2113 #[doc = "Inertial Measurement Unit (IMU) #3."]
2114 MAV_COMP_ID_IMU_3 = 202,
2115 #[doc = "GPS #1."]
2116 MAV_COMP_ID_GPS = 220,
2117 #[doc = "GPS #2."]
2118 MAV_COMP_ID_GPS2 = 221,
2119 #[doc = "Open Drone ID transmitter/receiver (Bluetooth/WiFi/Internet)."]
2120 MAV_COMP_ID_ODID_TXRX_1 = 236,
2121 #[doc = "Open Drone ID transmitter/receiver (Bluetooth/WiFi/Internet)."]
2122 MAV_COMP_ID_ODID_TXRX_2 = 237,
2123 #[doc = "Open Drone ID transmitter/receiver (Bluetooth/WiFi/Internet)."]
2124 MAV_COMP_ID_ODID_TXRX_3 = 238,
2125 #[doc = "Component to bridge MAVLink to UDP (i.e. from a UART)."]
2126 MAV_COMP_ID_UDP_BRIDGE = 240,
2127 #[doc = "Component to bridge to UART (i.e. from UDP)."]
2128 MAV_COMP_ID_UART_BRIDGE = 241,
2129 #[doc = "Component handling TUNNEL messages (e.g. vendor specific GUI of a component)."]
2130 MAV_COMP_ID_TUNNEL_NODE = 242,
2131 #[doc = "Illuminator"]
2132 MAV_COMP_ID_ILLUMINATOR = 243,
2133 #[deprecated = "System control does not require a separate component ID. Instead, system commands should be sent with target_component=MAV_COMP_ID_ALL allowing the target component to use any appropriate component id. See `MAV_COMP_ID_ALL` (Deprecated since 2018-11)"]
2134 #[doc = "Deprecated, don't use. Component for handling system messages (e.g. to ARM, takeoff, etc.)."]
2135 MAV_COMP_ID_SYSTEM_CONTROL = 250,
2136}
2137impl MavComponent {
2138 pub const DEFAULT: Self = Self::MAV_COMP_ID_ALL;
2139}
2140impl Default for MavComponent {
2141 fn default() -> Self {
2142 Self::DEFAULT
2143 }
2144}
2145#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2146#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2147#[cfg_attr(feature = "serde", serde(tag = "type"))]
2148#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2149#[repr(u32)]
2150#[deprecated = " See `MESSAGE_INTERVAL` (Deprecated since 2015-06)"]
2151#[doc = "A data stream is not a fixed set of messages, but rather a recommendation to the autopilot software. Individual autopilots may or may not obey the recommended messages."]
2152pub enum MavDataStream {
2153 #[doc = "Enable all data streams"]
2154 MAV_DATA_STREAM_ALL = 0,
2155 #[doc = "Enable IMU_RAW, GPS_RAW, GPS_STATUS packets."]
2156 MAV_DATA_STREAM_RAW_SENSORS = 1,
2157 #[doc = "Enable GPS_STATUS, CONTROL_STATUS, AUX_STATUS"]
2158 MAV_DATA_STREAM_EXTENDED_STATUS = 2,
2159 #[doc = "Enable RC_CHANNELS_SCALED, RC_CHANNELS_RAW, SERVO_OUTPUT_RAW"]
2160 MAV_DATA_STREAM_RC_CHANNELS = 3,
2161 #[doc = "Enable ATTITUDE_CONTROLLER_OUTPUT, POSITION_CONTROLLER_OUTPUT, NAV_CONTROLLER_OUTPUT."]
2162 MAV_DATA_STREAM_RAW_CONTROLLER = 4,
2163 #[doc = "Enable LOCAL_POSITION, GLOBAL_POSITION_INT messages."]
2164 MAV_DATA_STREAM_POSITION = 6,
2165 #[doc = "Dependent on the autopilot"]
2166 MAV_DATA_STREAM_EXTRA1 = 10,
2167 #[doc = "Dependent on the autopilot"]
2168 MAV_DATA_STREAM_EXTRA2 = 11,
2169 #[doc = "Dependent on the autopilot"]
2170 MAV_DATA_STREAM_EXTRA3 = 12,
2171}
2172impl MavDataStream {
2173 pub const DEFAULT: Self = Self::MAV_DATA_STREAM_ALL;
2174}
2175impl Default for MavDataStream {
2176 fn default() -> Self {
2177 Self::DEFAULT
2178 }
2179}
2180#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2181#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2182#[cfg_attr(feature = "serde", serde(tag = "type"))]
2183#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2184#[repr(u32)]
2185#[doc = "Enumeration of distance sensor types"]
2186pub enum MavDistanceSensor {
2187 #[doc = "Laser rangefinder, e.g. LightWare SF02/F or PulsedLight units"]
2188 MAV_DISTANCE_SENSOR_LASER = 0,
2189 #[doc = "Ultrasound rangefinder, e.g. MaxBotix units"]
2190 MAV_DISTANCE_SENSOR_ULTRASOUND = 1,
2191 #[doc = "Infrared rangefinder, e.g. Sharp units"]
2192 MAV_DISTANCE_SENSOR_INFRARED = 2,
2193 #[doc = "Radar type, e.g. uLanding units"]
2194 MAV_DISTANCE_SENSOR_RADAR = 3,
2195 #[doc = "Broken or unknown type, e.g. analog units"]
2196 MAV_DISTANCE_SENSOR_UNKNOWN = 4,
2197}
2198impl MavDistanceSensor {
2199 pub const DEFAULT: Self = Self::MAV_DISTANCE_SENSOR_LASER;
2200}
2201impl Default for MavDistanceSensor {
2202 fn default() -> Self {
2203 Self::DEFAULT
2204 }
2205}
2206#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2207#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2208#[cfg_attr(feature = "serde", serde(tag = "type"))]
2209#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2210#[repr(u32)]
2211#[doc = "Bitmap of options for the MAV_CMD_DO_REPOSITION"]
2212pub enum MavDoRepositionFlags {
2213 #[doc = "The aircraft should immediately transition into guided. This should not be set for follow me applications"]
2214 MAV_DO_REPOSITION_FLAGS_CHANGE_MODE = 1,
2215}
2216impl MavDoRepositionFlags {
2217 pub const DEFAULT: Self = Self::MAV_DO_REPOSITION_FLAGS_CHANGE_MODE;
2218}
2219impl Default for MavDoRepositionFlags {
2220 fn default() -> Self {
2221 Self::DEFAULT
2222 }
2223}
2224#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2225#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2226#[cfg_attr(feature = "serde", serde(tag = "type"))]
2227#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2228#[repr(u32)]
2229#[doc = "Enumeration of estimator types"]
2230pub enum MavEstimatorType {
2231 #[doc = "Unknown type of the estimator."]
2232 MAV_ESTIMATOR_TYPE_UNKNOWN = 0,
2233 #[doc = "This is a naive estimator without any real covariance feedback."]
2234 MAV_ESTIMATOR_TYPE_NAIVE = 1,
2235 #[doc = "Computer vision based estimate. Might be up to scale."]
2236 MAV_ESTIMATOR_TYPE_VISION = 2,
2237 #[doc = "Visual-inertial estimate."]
2238 MAV_ESTIMATOR_TYPE_VIO = 3,
2239 #[doc = "Plain GPS estimate."]
2240 MAV_ESTIMATOR_TYPE_GPS = 4,
2241 #[doc = "Estimator integrating GPS and inertial sensing."]
2242 MAV_ESTIMATOR_TYPE_GPS_INS = 5,
2243 #[doc = "Estimate from external motion capturing system."]
2244 MAV_ESTIMATOR_TYPE_MOCAP = 6,
2245 #[doc = "Estimator based on lidar sensor input."]
2246 MAV_ESTIMATOR_TYPE_LIDAR = 7,
2247 #[doc = "Estimator on autopilot."]
2248 MAV_ESTIMATOR_TYPE_AUTOPILOT = 8,
2249}
2250impl MavEstimatorType {
2251 pub const DEFAULT: Self = Self::MAV_ESTIMATOR_TYPE_UNKNOWN;
2252}
2253impl Default for MavEstimatorType {
2254 fn default() -> Self {
2255 Self::DEFAULT
2256 }
2257}
2258#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2259#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2260#[cfg_attr(feature = "serde", serde(tag = "type"))]
2261#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2262#[repr(u32)]
2263#[doc = "Flags for CURRENT_EVENT_SEQUENCE."]
2264pub enum MavEventCurrentSequenceFlags {
2265 #[doc = "A sequence reset has happened (e.g. vehicle reboot)."]
2266 MAV_EVENT_CURRENT_SEQUENCE_FLAGS_RESET = 1,
2267}
2268impl MavEventCurrentSequenceFlags {
2269 pub const DEFAULT: Self = Self::MAV_EVENT_CURRENT_SEQUENCE_FLAGS_RESET;
2270}
2271impl Default for MavEventCurrentSequenceFlags {
2272 fn default() -> Self {
2273 Self::DEFAULT
2274 }
2275}
2276#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2277#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2278#[cfg_attr(feature = "serde", serde(tag = "type"))]
2279#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2280#[repr(u32)]
2281#[doc = "Reason for an event error response."]
2282pub enum MavEventErrorReason {
2283 #[doc = "The requested event is not available (anymore)."]
2284 MAV_EVENT_ERROR_REASON_UNAVAILABLE = 0,
2285}
2286impl MavEventErrorReason {
2287 pub const DEFAULT: Self = Self::MAV_EVENT_ERROR_REASON_UNAVAILABLE;
2288}
2289impl Default for MavEventErrorReason {
2290 fn default() -> Self {
2291 Self::DEFAULT
2292 }
2293}
2294#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2295#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2296#[cfg_attr(feature = "serde", serde(tag = "type"))]
2297#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2298#[repr(u32)]
2299#[doc = "Coordinate frames used by MAVLink. Not all frames are supported by all commands, messages, or vehicles. Global frames use the following naming conventions: - \"GLOBAL\": Global coordinate frame with WGS84 latitude/longitude and altitude positive over mean sea level (MSL) by default. The following modifiers may be used with \"GLOBAL\": - \"RELATIVE_ALT\": Altitude is relative to the vehicle home position rather than MSL. - \"TERRAIN_ALT\": Altitude is relative to ground level rather than MSL. - \"INT\": Latitude/longitude (in degrees) are scaled by multiplying by 1E7. Local frames use the following naming conventions: - \"LOCAL\": Origin of local frame is fixed relative to earth. Unless otherwise specified this origin is the origin of the vehicle position-estimator (\"EKF\"). - \"BODY\": Origin of local frame travels with the vehicle. NOTE, \"BODY\" does NOT indicate alignment of frame axis with vehicle attitude. - \"OFFSET\": Deprecated synonym for \"BODY\" (origin travels with the vehicle). Not to be used for new frames. Some deprecated frames do not follow these conventions (e.g. MAV_FRAME_BODY_NED and MAV_FRAME_BODY_OFFSET_NED)."]
2300pub enum MavFrame {
2301 #[doc = "Global (WGS84) coordinate frame + altitude relative to mean sea level (MSL)."]
2302 MAV_FRAME_GLOBAL = 0,
2303 #[doc = "NED local tangent frame (x: North, y: East, z: Down) with origin fixed relative to earth."]
2304 MAV_FRAME_LOCAL_NED = 1,
2305 #[doc = "NOT a coordinate frame, indicates a mission command."]
2306 MAV_FRAME_MISSION = 2,
2307 #[doc = "Global (WGS84) coordinate frame + altitude relative to the home position."]
2308 MAV_FRAME_GLOBAL_RELATIVE_ALT = 3,
2309 #[doc = "ENU local tangent frame (x: East, y: North, z: Up) with origin fixed relative to earth."]
2310 MAV_FRAME_LOCAL_ENU = 4,
2311 #[deprecated = "Use MAV_FRAME_GLOBAL in COMMAND_INT (and elsewhere) as a synonymous replacement. See `MAV_FRAME_GLOBAL` (Deprecated since 2024-03)"]
2312 #[doc = "Global (WGS84) coordinate frame (scaled) + altitude relative to mean sea level (MSL)."]
2313 MAV_FRAME_GLOBAL_INT = 5,
2314 #[deprecated = "Use MAV_FRAME_GLOBAL_RELATIVE_ALT in COMMAND_INT (and elsewhere) as a synonymous replacement. See `MAV_FRAME_GLOBAL_RELATIVE_ALT` (Deprecated since 2024-03)"]
2315 #[doc = "Global (WGS84) coordinate frame (scaled) + altitude relative to the home position."]
2316 MAV_FRAME_GLOBAL_RELATIVE_ALT_INT = 6,
2317 #[doc = "NED local tangent frame (x: North, y: East, z: Down) with origin that travels with the vehicle."]
2318 MAV_FRAME_LOCAL_OFFSET_NED = 7,
2319 #[deprecated = " See `MAV_FRAME_BODY_FRD` (Deprecated since 2019-08)"]
2320 #[doc = "Same as MAV_FRAME_LOCAL_NED when used to represent position values. Same as MAV_FRAME_BODY_FRD when used with velocity/acceleration values."]
2321 MAV_FRAME_BODY_NED = 8,
2322 #[deprecated = " See `MAV_FRAME_BODY_FRD` (Deprecated since 2019-08)"]
2323 #[doc = "This is the same as MAV_FRAME_BODY_FRD."]
2324 MAV_FRAME_BODY_OFFSET_NED = 9,
2325 #[doc = "Global (WGS84) coordinate frame with AGL altitude (altitude at ground level)."]
2326 MAV_FRAME_GLOBAL_TERRAIN_ALT = 10,
2327 #[deprecated = "Use MAV_FRAME_GLOBAL_TERRAIN_ALT in COMMAND_INT (and elsewhere) as a synonymous replacement. See `MAV_FRAME_GLOBAL_TERRAIN_ALT` (Deprecated since 2024-03)"]
2328 #[doc = "Global (WGS84) coordinate frame (scaled) with AGL altitude (altitude at ground level)."]
2329 MAV_FRAME_GLOBAL_TERRAIN_ALT_INT = 11,
2330 #[doc = "FRD local frame aligned to the vehicle's attitude (x: Forward, y: Right, z: Down) with an origin that travels with vehicle."]
2331 MAV_FRAME_BODY_FRD = 12,
2332 #[deprecated = " (Deprecated since 2019-04)"]
2333 #[doc = "MAV_FRAME_BODY_FLU - Body fixed frame of reference, Z-up (x: Forward, y: Left, z: Up)."]
2334 MAV_FRAME_RESERVED_13 = 13,
2335 #[deprecated = " See `MAV_FRAME_LOCAL_FRD` (Deprecated since 2019-04)"]
2336 #[doc = "MAV_FRAME_MOCAP_NED - Odometry local coordinate frame of data given by a motion capture system, Z-down (x: North, y: East, z: Down)."]
2337 MAV_FRAME_RESERVED_14 = 14,
2338 #[deprecated = " See `MAV_FRAME_LOCAL_FLU` (Deprecated since 2019-04)"]
2339 #[doc = "MAV_FRAME_MOCAP_ENU - Odometry local coordinate frame of data given by a motion capture system, Z-up (x: East, y: North, z: Up)."]
2340 MAV_FRAME_RESERVED_15 = 15,
2341 #[deprecated = " See `MAV_FRAME_LOCAL_FRD` (Deprecated since 2019-04)"]
2342 #[doc = "MAV_FRAME_VISION_NED - Odometry local coordinate frame of data given by a vision estimation system, Z-down (x: North, y: East, z: Down)."]
2343 MAV_FRAME_RESERVED_16 = 16,
2344 #[deprecated = " See `MAV_FRAME_LOCAL_FLU` (Deprecated since 2019-04)"]
2345 #[doc = "MAV_FRAME_VISION_ENU - Odometry local coordinate frame of data given by a vision estimation system, Z-up (x: East, y: North, z: Up)."]
2346 MAV_FRAME_RESERVED_17 = 17,
2347 #[deprecated = " See `MAV_FRAME_LOCAL_FRD` (Deprecated since 2019-04)"]
2348 #[doc = "MAV_FRAME_ESTIM_NED - Odometry local coordinate frame of data given by an estimator running onboard the vehicle, Z-down (x: North, y: East, z: Down)."]
2349 MAV_FRAME_RESERVED_18 = 18,
2350 #[deprecated = " See `MAV_FRAME_LOCAL_FLU` (Deprecated since 2019-04)"]
2351 #[doc = "MAV_FRAME_ESTIM_ENU - Odometry local coordinate frame of data given by an estimator running onboard the vehicle, Z-up (x: East, y: North, z: Up)."]
2352 MAV_FRAME_RESERVED_19 = 19,
2353 #[doc = "FRD local tangent frame (x: Forward, y: Right, z: Down) with origin fixed relative to earth. The forward axis is aligned to the front of the vehicle in the horizontal plane."]
2354 MAV_FRAME_LOCAL_FRD = 20,
2355 #[doc = "FLU local tangent frame (x: Forward, y: Left, z: Up) with origin fixed relative to earth. The forward axis is aligned to the front of the vehicle in the horizontal plane."]
2356 MAV_FRAME_LOCAL_FLU = 21,
2357}
2358impl MavFrame {
2359 pub const DEFAULT: Self = Self::MAV_FRAME_GLOBAL;
2360}
2361impl Default for MavFrame {
2362 fn default() -> Self {
2363 Self::DEFAULT
2364 }
2365}
2366#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2367#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2368#[cfg_attr(feature = "serde", serde(tag = "type"))]
2369#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2370#[repr(u32)]
2371#[doc = "MAV FTP error codes (<https://mavlink.io/en/services/ftp.html>)"]
2372pub enum MavFtpErr {
2373 #[doc = "None: No error"]
2374 MAV_FTP_ERR_NONE = 0,
2375 #[doc = "Fail: Unknown failure"]
2376 MAV_FTP_ERR_FAIL = 1,
2377 #[doc = "FailErrno: Command failed, Err number sent back in PayloadHeader.data[1]. \t\tThis is a file-system error number understood by the server operating system."]
2378 MAV_FTP_ERR_FAILERRNO = 2,
2379 #[doc = "InvalidDataSize: Payload size is invalid"]
2380 MAV_FTP_ERR_INVALIDDATASIZE = 3,
2381 #[doc = "InvalidSession: Session is not currently open"]
2382 MAV_FTP_ERR_INVALIDSESSION = 4,
2383 #[doc = "NoSessionsAvailable: All available sessions are already in use"]
2384 MAV_FTP_ERR_NOSESSIONSAVAILABLE = 5,
2385 #[doc = "EOF: Offset past end of file for ListDirectory and ReadFile commands"]
2386 MAV_FTP_ERR_EOF = 6,
2387 #[doc = "UnknownCommand: Unknown command / opcode"]
2388 MAV_FTP_ERR_UNKNOWNCOMMAND = 7,
2389 #[doc = "FileExists: File/directory already exists"]
2390 MAV_FTP_ERR_FILEEXISTS = 8,
2391 #[doc = "FileProtected: File/directory is write protected"]
2392 MAV_FTP_ERR_FILEPROTECTED = 9,
2393 #[doc = "FileNotFound: File/directory not found"]
2394 MAV_FTP_ERR_FILENOTFOUND = 10,
2395}
2396impl MavFtpErr {
2397 pub const DEFAULT: Self = Self::MAV_FTP_ERR_NONE;
2398}
2399impl Default for MavFtpErr {
2400 fn default() -> Self {
2401 Self::DEFAULT
2402 }
2403}
2404#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2405#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2406#[cfg_attr(feature = "serde", serde(tag = "type"))]
2407#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2408#[repr(u32)]
2409#[doc = "MAV FTP opcodes: <https://mavlink.io/en/services/ftp.html>"]
2410pub enum MavFtpOpcode {
2411 #[doc = "None. Ignored, always ACKed"]
2412 MAV_FTP_OPCODE_NONE = 0,
2413 #[doc = "TerminateSession: Terminates open Read session"]
2414 MAV_FTP_OPCODE_TERMINATESESSION = 1,
2415 #[doc = "ResetSessions: Terminates all open read sessions"]
2416 MAV_FTP_OPCODE_RESETSESSION = 2,
2417 #[doc = "ListDirectory. List files and directories in path from offset"]
2418 MAV_FTP_OPCODE_LISTDIRECTORY = 3,
2419 #[doc = "OpenFileRO: Opens file at path for reading, returns session"]
2420 MAV_FTP_OPCODE_OPENFILERO = 4,
2421 #[doc = "ReadFile: Reads size bytes from offset in session"]
2422 MAV_FTP_OPCODE_READFILE = 5,
2423 #[doc = "CreateFile: Creates file at path for writing, returns session"]
2424 MAV_FTP_OPCODE_CREATEFILE = 6,
2425 #[doc = "WriteFile: Writes size bytes to offset in session"]
2426 MAV_FTP_OPCODE_WRITEFILE = 7,
2427 #[doc = "RemoveFile: Remove file at path"]
2428 MAV_FTP_OPCODE_REMOVEFILE = 8,
2429 #[doc = "CreateDirectory: Creates directory at path"]
2430 MAV_FTP_OPCODE_CREATEDIRECTORY = 9,
2431 #[doc = "RemoveDirectory: Removes directory at path. The directory must be empty."]
2432 MAV_FTP_OPCODE_REMOVEDIRECTORY = 10,
2433 #[doc = "OpenFileWO: Opens file at path for writing, returns session"]
2434 MAV_FTP_OPCODE_OPENFILEWO = 11,
2435 #[doc = "TruncateFile: Truncate file at path to offset length"]
2436 MAV_FTP_OPCODE_TRUNCATEFILE = 12,
2437 #[doc = "Rename: Rename path1 to path2"]
2438 MAV_FTP_OPCODE_RENAME = 13,
2439 #[doc = "CalcFileCRC32: Calculate CRC32 for file at path"]
2440 MAV_FTP_OPCODE_CALCFILECRC = 14,
2441 #[doc = "BurstReadFile: Burst download session file"]
2442 MAV_FTP_OPCODE_BURSTREADFILE = 15,
2443 #[doc = "ACK: ACK response"]
2444 MAV_FTP_OPCODE_ACK = 128,
2445 #[doc = "NAK: NAK response"]
2446 MAV_FTP_OPCODE_NAK = 129,
2447}
2448impl MavFtpOpcode {
2449 pub const DEFAULT: Self = Self::MAV_FTP_OPCODE_NONE;
2450}
2451impl Default for MavFtpOpcode {
2452 fn default() -> Self {
2453 Self::DEFAULT
2454 }
2455}
2456#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2457#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2458#[cfg_attr(feature = "serde", serde(tag = "type"))]
2459#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2460#[repr(u32)]
2461#[doc = "Fuel types for use in FUEL_TYPE. Fuel types specify the units for the maximum, available and consumed fuel, and for the flow rates."]
2462pub enum MavFuelType {
2463 #[doc = "Not specified. Fuel levels are normalized (i.e. maximum is 1, and other levels are relative to 1)."]
2464 MAV_FUEL_TYPE_UNKNOWN = 0,
2465 #[doc = "A generic liquid fuel. Fuel levels are in millilitres (ml). Fuel rates are in millilitres/second."]
2466 MAV_FUEL_TYPE_LIQUID = 1,
2467 #[doc = "A gas tank. Fuel levels are in kilo-Pascal (kPa), and flow rates are in milliliters per second (ml/s)."]
2468 MAV_FUEL_TYPE_GAS = 2,
2469}
2470impl MavFuelType {
2471 pub const DEFAULT: Self = Self::MAV_FUEL_TYPE_UNKNOWN;
2472}
2473impl Default for MavFuelType {
2474 fn default() -> Self {
2475 Self::DEFAULT
2476 }
2477}
2478bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Flags to report status/failure cases for a power generator (used in GENERATOR_STATUS). Note that FAULTS are conditions that cause the generator to fail. Warnings are conditions that require attention before the next use (they indicate the system is not operating properly)."] pub struct MavGeneratorStatusFlag : u64 { # [doc = "Generator is off."] const MAV_GENERATOR_STATUS_FLAG_OFF = 1 ; # [doc = "Generator is ready to start generating power."] const MAV_GENERATOR_STATUS_FLAG_READY = 2 ; # [doc = "Generator is generating power."] const MAV_GENERATOR_STATUS_FLAG_GENERATING = 4 ; # [doc = "Generator is charging the batteries (generating enough power to charge and provide the load)."] const MAV_GENERATOR_STATUS_FLAG_CHARGING = 8 ; # [doc = "Generator is operating at a reduced maximum power."] const MAV_GENERATOR_STATUS_FLAG_REDUCED_POWER = 16 ; # [doc = "Generator is providing the maximum output."] const MAV_GENERATOR_STATUS_FLAG_MAXPOWER = 32 ; # [doc = "Generator is near the maximum operating temperature, cooling is insufficient."] const MAV_GENERATOR_STATUS_FLAG_OVERTEMP_WARNING = 64 ; # [doc = "Generator hit the maximum operating temperature and shutdown."] const MAV_GENERATOR_STATUS_FLAG_OVERTEMP_FAULT = 128 ; # [doc = "Power electronics are near the maximum operating temperature, cooling is insufficient."] const MAV_GENERATOR_STATUS_FLAG_ELECTRONICS_OVERTEMP_WARNING = 256 ; # [doc = "Power electronics hit the maximum operating temperature and shutdown."] const MAV_GENERATOR_STATUS_FLAG_ELECTRONICS_OVERTEMP_FAULT = 512 ; # [doc = "Power electronics experienced a fault and shutdown."] const MAV_GENERATOR_STATUS_FLAG_ELECTRONICS_FAULT = 1024 ; # [doc = "The power source supplying the generator failed e.g. mechanical generator stopped, tether is no longer providing power, solar cell is in shade, hydrogen reaction no longer happening."] const MAV_GENERATOR_STATUS_FLAG_POWERSOURCE_FAULT = 2048 ; # [doc = "Generator controller having communication problems."] const MAV_GENERATOR_STATUS_FLAG_COMMUNICATION_WARNING = 4096 ; # [doc = "Power electronic or generator cooling system error."] const MAV_GENERATOR_STATUS_FLAG_COOLING_WARNING = 8192 ; # [doc = "Generator controller power rail experienced a fault."] const MAV_GENERATOR_STATUS_FLAG_POWER_RAIL_FAULT = 16384 ; # [doc = "Generator controller exceeded the overcurrent threshold and shutdown to prevent damage."] const MAV_GENERATOR_STATUS_FLAG_OVERCURRENT_FAULT = 32768 ; # [doc = "Generator controller detected a high current going into the batteries and shutdown to prevent battery damage."] const MAV_GENERATOR_STATUS_FLAG_BATTERY_OVERCHARGE_CURRENT_FAULT = 65536 ; # [doc = "Generator controller exceeded it's overvoltage threshold and shutdown to prevent it exceeding the voltage rating."] const MAV_GENERATOR_STATUS_FLAG_OVERVOLTAGE_FAULT = 131072 ; # [doc = "Batteries are under voltage (generator will not start)."] const MAV_GENERATOR_STATUS_FLAG_BATTERY_UNDERVOLT_FAULT = 262144 ; # [doc = "Generator start is inhibited by e.g. a safety switch."] const MAV_GENERATOR_STATUS_FLAG_START_INHIBITED = 524288 ; # [doc = "Generator requires maintenance."] const MAV_GENERATOR_STATUS_FLAG_MAINTENANCE_REQUIRED = 1048576 ; # [doc = "Generator is not ready to generate yet."] const MAV_GENERATOR_STATUS_FLAG_WARMING_UP = 2097152 ; # [doc = "Generator is idle."] const MAV_GENERATOR_STATUS_FLAG_IDLE = 4194304 ; } }
2479impl MavGeneratorStatusFlag {
2480 pub const DEFAULT: Self = Self::MAV_GENERATOR_STATUS_FLAG_OFF;
2481}
2482impl Default for MavGeneratorStatusFlag {
2483 fn default() -> Self {
2484 Self::DEFAULT
2485 }
2486}
2487#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2488#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2489#[cfg_attr(feature = "serde", serde(tag = "type"))]
2490#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2491#[repr(u32)]
2492#[doc = "Actions that may be specified in MAV_CMD_OVERRIDE_GOTO to override mission execution."]
2493pub enum MavGoto {
2494 #[doc = "Hold at the current position."]
2495 MAV_GOTO_DO_HOLD = 0,
2496 #[doc = "Continue with the next item in mission execution."]
2497 MAV_GOTO_DO_CONTINUE = 1,
2498 #[doc = "Hold at the current position of the system"]
2499 MAV_GOTO_HOLD_AT_CURRENT_POSITION = 2,
2500 #[doc = "Hold at the position specified in the parameters of the DO_HOLD action"]
2501 MAV_GOTO_HOLD_AT_SPECIFIED_POSITION = 3,
2502}
2503impl MavGoto {
2504 pub const DEFAULT: Self = Self::MAV_GOTO_DO_HOLD;
2505}
2506impl Default for MavGoto {
2507 fn default() -> Self {
2508 Self::DEFAULT
2509 }
2510}
2511#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2512#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2513#[cfg_attr(feature = "serde", serde(tag = "type"))]
2514#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2515#[repr(u32)]
2516#[doc = "Enumeration of landed detector states"]
2517pub enum MavLandedState {
2518 #[doc = "MAV landed state is unknown"]
2519 MAV_LANDED_STATE_UNDEFINED = 0,
2520 #[doc = "MAV is landed (on ground)"]
2521 MAV_LANDED_STATE_ON_GROUND = 1,
2522 #[doc = "MAV is in air"]
2523 MAV_LANDED_STATE_IN_AIR = 2,
2524 #[doc = "MAV currently taking off"]
2525 MAV_LANDED_STATE_TAKEOFF = 3,
2526 #[doc = "MAV currently landing"]
2527 MAV_LANDED_STATE_LANDING = 4,
2528}
2529impl MavLandedState {
2530 pub const DEFAULT: Self = Self::MAV_LANDED_STATE_UNDEFINED;
2531}
2532impl Default for MavLandedState {
2533 fn default() -> Self {
2534 Self::DEFAULT
2535 }
2536}
2537#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2538#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2539#[cfg_attr(feature = "serde", serde(tag = "type"))]
2540#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2541#[repr(u32)]
2542#[doc = "Result of mission operation (in a MISSION_ACK message)."]
2543pub enum MavMissionResult {
2544 #[doc = "mission accepted OK"]
2545 MAV_MISSION_ACCEPTED = 0,
2546 #[doc = "Generic error / not accepting mission commands at all right now."]
2547 MAV_MISSION_ERROR = 1,
2548 #[doc = "Coordinate frame is not supported."]
2549 MAV_MISSION_UNSUPPORTED_FRAME = 2,
2550 #[doc = "Command is not supported."]
2551 MAV_MISSION_UNSUPPORTED = 3,
2552 #[doc = "Mission items exceed storage space."]
2553 MAV_MISSION_NO_SPACE = 4,
2554 #[doc = "One of the parameters has an invalid value."]
2555 MAV_MISSION_INVALID = 5,
2556 #[doc = "param1 has an invalid value."]
2557 MAV_MISSION_INVALID_PARAM1 = 6,
2558 #[doc = "param2 has an invalid value."]
2559 MAV_MISSION_INVALID_PARAM2 = 7,
2560 #[doc = "param3 has an invalid value."]
2561 MAV_MISSION_INVALID_PARAM3 = 8,
2562 #[doc = "param4 has an invalid value."]
2563 MAV_MISSION_INVALID_PARAM4 = 9,
2564 #[doc = "x / param5 has an invalid value."]
2565 MAV_MISSION_INVALID_PARAM5_X = 10,
2566 #[doc = "y / param6 has an invalid value."]
2567 MAV_MISSION_INVALID_PARAM6_Y = 11,
2568 #[doc = "z / param7 has an invalid value."]
2569 MAV_MISSION_INVALID_PARAM7 = 12,
2570 #[doc = "Mission item received out of sequence"]
2571 MAV_MISSION_INVALID_SEQUENCE = 13,
2572 #[doc = "Not accepting any mission commands from this communication partner."]
2573 MAV_MISSION_DENIED = 14,
2574 #[doc = "Current mission operation cancelled (e.g. mission upload, mission download)."]
2575 MAV_MISSION_OPERATION_CANCELLED = 15,
2576}
2577impl MavMissionResult {
2578 pub const DEFAULT: Self = Self::MAV_MISSION_ACCEPTED;
2579}
2580impl Default for MavMissionResult {
2581 fn default() -> Self {
2582 Self::DEFAULT
2583 }
2584}
2585#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2586#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2587#[cfg_attr(feature = "serde", serde(tag = "type"))]
2588#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2589#[repr(u32)]
2590#[doc = "Type of mission items being requested/sent in mission protocol."]
2591pub enum MavMissionType {
2592 #[doc = "Items are mission commands for main mission."]
2593 MAV_MISSION_TYPE_MISSION = 0,
2594 #[doc = "Specifies GeoFence area(s). Items are MAV_CMD_NAV_FENCE_ GeoFence items."]
2595 MAV_MISSION_TYPE_FENCE = 1,
2596 #[doc = "Specifies the rally points for the vehicle. Rally points are alternative RTL points. Items are MAV_CMD_NAV_RALLY_POINT rally point items."]
2597 MAV_MISSION_TYPE_RALLY = 2,
2598 #[doc = "Only used in MISSION_CLEAR_ALL to clear all mission types."]
2599 MAV_MISSION_TYPE_ALL = 255,
2600}
2601impl MavMissionType {
2602 pub const DEFAULT: Self = Self::MAV_MISSION_TYPE_MISSION;
2603}
2604impl Default for MavMissionType {
2605 fn default() -> Self {
2606 Self::DEFAULT
2607 }
2608}
2609#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2610#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2611#[cfg_attr(feature = "serde", serde(tag = "type"))]
2612#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2613#[repr(u32)]
2614#[doc = "These defines are predefined OR-combined mode flags. There is no need to use values from this enum, but it simplifies the use of the mode flags. Note that manual input is enabled in all modes as a safety override."]
2615pub enum MavMode {
2616 #[doc = "System is not ready to fly, booting, calibrating, etc. No flag is set."]
2617 MAV_MODE_PREFLIGHT = 0,
2618 #[doc = "System is allowed to be active, under assisted RC control."]
2619 MAV_MODE_STABILIZE_DISARMED = 80,
2620 #[doc = "System is allowed to be active, under assisted RC control."]
2621 MAV_MODE_STABILIZE_ARMED = 208,
2622 #[doc = "System is allowed to be active, under manual (RC) control, no stabilization"]
2623 MAV_MODE_MANUAL_DISARMED = 64,
2624 #[doc = "System is allowed to be active, under manual (RC) control, no stabilization"]
2625 MAV_MODE_MANUAL_ARMED = 192,
2626 #[doc = "System is allowed to be active, under autonomous control, manual setpoint"]
2627 MAV_MODE_GUIDED_DISARMED = 88,
2628 #[doc = "System is allowed to be active, under autonomous control, manual setpoint"]
2629 MAV_MODE_GUIDED_ARMED = 216,
2630 #[doc = "System is allowed to be active, under autonomous control and navigation (the trajectory is decided onboard and not pre-programmed by waypoints)"]
2631 MAV_MODE_AUTO_DISARMED = 92,
2632 #[doc = "System is allowed to be active, under autonomous control and navigation (the trajectory is decided onboard and not pre-programmed by waypoints)"]
2633 MAV_MODE_AUTO_ARMED = 220,
2634 #[doc = "UNDEFINED mode. This solely depends on the autopilot - use with caution, intended for developers only."]
2635 MAV_MODE_TEST_DISARMED = 66,
2636 #[doc = "UNDEFINED mode. This solely depends on the autopilot - use with caution, intended for developers only."]
2637 MAV_MODE_TEST_ARMED = 194,
2638}
2639impl MavMode {
2640 pub const DEFAULT: Self = Self::MAV_MODE_PREFLIGHT;
2641}
2642impl Default for MavMode {
2643 fn default() -> Self {
2644 Self::DEFAULT
2645 }
2646}
2647bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "These flags encode the MAV mode."] pub struct MavModeFlag : u8 { # [doc = "0b10000000 MAV safety set to armed. Motors are enabled / running / can start. Ready to fly. Additional note: this flag is to be ignore when sent in the command MAV_CMD_DO_SET_MODE and MAV_CMD_COMPONENT_ARM_DISARM shall be used instead. The flag can still be used to report the armed state."] const MAV_MODE_FLAG_SAFETY_ARMED = 128 ; # [doc = "0b01000000 remote control input is enabled."] const MAV_MODE_FLAG_MANUAL_INPUT_ENABLED = 64 ; # [doc = "0b00100000 hardware in the loop simulation. All motors / actuators are blocked, but internal software is full operational."] const MAV_MODE_FLAG_HIL_ENABLED = 32 ; # [doc = "0b00010000 system stabilizes electronically its attitude (and optionally position). It needs however further control inputs to move around."] const MAV_MODE_FLAG_STABILIZE_ENABLED = 16 ; # [doc = "0b00001000 guided mode enabled, system flies waypoints / mission items."] const MAV_MODE_FLAG_GUIDED_ENABLED = 8 ; # [doc = "0b00000100 autonomous mode enabled, system finds its own goal positions. Guided flag can be set or not, depends on the actual implementation."] const MAV_MODE_FLAG_AUTO_ENABLED = 4 ; # [doc = "0b00000010 system has a test mode enabled. This flag is intended for temporary system tests and should not be used for stable implementations."] const MAV_MODE_FLAG_TEST_ENABLED = 2 ; # [doc = "0b00000001 Reserved for future use."] const MAV_MODE_FLAG_CUSTOM_MODE_ENABLED = 1 ; } }
2648impl MavModeFlag {
2649 pub const DEFAULT: Self = Self::MAV_MODE_FLAG_SAFETY_ARMED;
2650}
2651impl Default for MavModeFlag {
2652 fn default() -> Self {
2653 Self::DEFAULT
2654 }
2655}
2656#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2657#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2658#[cfg_attr(feature = "serde", serde(tag = "type"))]
2659#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2660#[repr(u32)]
2661#[doc = "These values encode the bit positions of the decode position. These values can be used to read the value of a flag bit by combining the base_mode variable with AND with the flag position value. The result will be either 0 or 1, depending on if the flag is set or not."]
2662pub enum MavModeFlagDecodePosition {
2663 #[doc = "First bit: 10000000"]
2664 MAV_MODE_FLAG_DECODE_POSITION_SAFETY = 128,
2665 #[doc = "Second bit: 01000000"]
2666 MAV_MODE_FLAG_DECODE_POSITION_MANUAL = 64,
2667 #[doc = "Third bit: 00100000"]
2668 MAV_MODE_FLAG_DECODE_POSITION_HIL = 32,
2669 #[doc = "Fourth bit: 00010000"]
2670 MAV_MODE_FLAG_DECODE_POSITION_STABILIZE = 16,
2671 #[doc = "Fifth bit: 00001000"]
2672 MAV_MODE_FLAG_DECODE_POSITION_GUIDED = 8,
2673 #[doc = "Sixth bit: 00000100"]
2674 MAV_MODE_FLAG_DECODE_POSITION_AUTO = 4,
2675 #[doc = "Seventh bit: 00000010"]
2676 MAV_MODE_FLAG_DECODE_POSITION_TEST = 2,
2677 #[doc = "Eighth bit: 00000001"]
2678 MAV_MODE_FLAG_DECODE_POSITION_CUSTOM_MODE = 1,
2679}
2680impl MavModeFlagDecodePosition {
2681 pub const DEFAULT: Self = Self::MAV_MODE_FLAG_DECODE_POSITION_SAFETY;
2682}
2683impl Default for MavModeFlagDecodePosition {
2684 fn default() -> Self {
2685 Self::DEFAULT
2686 }
2687}
2688bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Mode properties."] pub struct MavModeProperty : u32 { # [doc = "If set, this mode is an advanced mode. For example a rate-controlled manual mode might be advanced, whereas a position-controlled manual mode is not. A GCS can optionally use this flag to configure the UI for its intended users."] const MAV_MODE_PROPERTY_ADVANCED = 1 ; # [doc = "If set, this mode should not be added to the list of selectable modes. The mode might still be selected by the FC directly (for example as part of a failsafe)."] const MAV_MODE_PROPERTY_NOT_USER_SELECTABLE = 2 ; # [doc = "If set, this mode is automatically controlled (it may use but does not require a manual controller). If unset the mode is a assumed to require user input (be a manual mode)."] const MAV_MODE_PROPERTY_AUTO_MODE = 4 ; } }
2689impl MavModeProperty {
2690 pub const DEFAULT: Self = Self::MAV_MODE_PROPERTY_ADVANCED;
2691}
2692impl Default for MavModeProperty {
2693 fn default() -> Self {
2694 Self::DEFAULT
2695 }
2696}
2697#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2698#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2699#[cfg_attr(feature = "serde", serde(tag = "type"))]
2700#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2701#[repr(u32)]
2702#[deprecated = " See `GIMBAL_MANAGER_FLAGS` (Deprecated since 2020-01)"]
2703#[doc = "Enumeration of possible mount operation modes. This message is used by obsolete/deprecated gimbal messages."]
2704pub enum MavMountMode {
2705 #[doc = "Load and keep safe position (Roll,Pitch,Yaw) from permanent memory and stop stabilization"]
2706 MAV_MOUNT_MODE_RETRACT = 0,
2707 #[doc = "Load and keep neutral position (Roll,Pitch,Yaw) from permanent memory."]
2708 MAV_MOUNT_MODE_NEUTRAL = 1,
2709 #[doc = "Load neutral position and start MAVLink Roll,Pitch,Yaw control with stabilization"]
2710 MAV_MOUNT_MODE_MAVLINK_TARGETING = 2,
2711 #[doc = "Load neutral position and start RC Roll,Pitch,Yaw control with stabilization"]
2712 MAV_MOUNT_MODE_RC_TARGETING = 3,
2713 #[doc = "Load neutral position and start to point to Lat,Lon,Alt"]
2714 MAV_MOUNT_MODE_GPS_POINT = 4,
2715 #[doc = "Gimbal tracks system with specified system ID"]
2716 MAV_MOUNT_MODE_SYSID_TARGET = 5,
2717 #[doc = "Gimbal tracks home position"]
2718 MAV_MOUNT_MODE_HOME_LOCATION = 6,
2719}
2720impl MavMountMode {
2721 pub const DEFAULT: Self = Self::MAV_MOUNT_MODE_RETRACT;
2722}
2723impl Default for MavMountMode {
2724 fn default() -> Self {
2725 Self::DEFAULT
2726 }
2727}
2728#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2729#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2730#[cfg_attr(feature = "serde", serde(tag = "type"))]
2731#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2732#[repr(u32)]
2733pub enum MavOdidArmStatus {
2734 #[doc = "Passing arming checks."]
2735 MAV_ODID_ARM_STATUS_GOOD_TO_ARM = 0,
2736 #[doc = "Generic arming failure, see error string for details."]
2737 MAV_ODID_ARM_STATUS_PRE_ARM_FAIL_GENERIC = 1,
2738}
2739impl MavOdidArmStatus {
2740 pub const DEFAULT: Self = Self::MAV_ODID_ARM_STATUS_GOOD_TO_ARM;
2741}
2742impl Default for MavOdidArmStatus {
2743 fn default() -> Self {
2744 Self::DEFAULT
2745 }
2746}
2747#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2748#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2749#[cfg_attr(feature = "serde", serde(tag = "type"))]
2750#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2751#[repr(u32)]
2752pub enum MavOdidAuthType {
2753 #[doc = "No authentication type is specified."]
2754 MAV_ODID_AUTH_TYPE_NONE = 0,
2755 #[doc = "Signature for the UAS (Unmanned Aircraft System) ID."]
2756 MAV_ODID_AUTH_TYPE_UAS_ID_SIGNATURE = 1,
2757 #[doc = "Signature for the Operator ID."]
2758 MAV_ODID_AUTH_TYPE_OPERATOR_ID_SIGNATURE = 2,
2759 #[doc = "Signature for the entire message set."]
2760 MAV_ODID_AUTH_TYPE_MESSAGE_SET_SIGNATURE = 3,
2761 #[doc = "Authentication is provided by Network Remote ID."]
2762 MAV_ODID_AUTH_TYPE_NETWORK_REMOTE_ID = 4,
2763 #[doc = "The exact authentication type is indicated by the first byte of authentication_data and these type values are managed by ICAO."]
2764 MAV_ODID_AUTH_TYPE_SPECIFIC_AUTHENTICATION = 5,
2765}
2766impl MavOdidAuthType {
2767 pub const DEFAULT: Self = Self::MAV_ODID_AUTH_TYPE_NONE;
2768}
2769impl Default for MavOdidAuthType {
2770 fn default() -> Self {
2771 Self::DEFAULT
2772 }
2773}
2774#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2775#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2776#[cfg_attr(feature = "serde", serde(tag = "type"))]
2777#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2778#[repr(u32)]
2779pub enum MavOdidCategoryEu {
2780 #[doc = "The category for the UA, according to the EU specification, is undeclared."]
2781 MAV_ODID_CATEGORY_EU_UNDECLARED = 0,
2782 #[doc = "The category for the UA, according to the EU specification, is the Open category."]
2783 MAV_ODID_CATEGORY_EU_OPEN = 1,
2784 #[doc = "The category for the UA, according to the EU specification, is the Specific category."]
2785 MAV_ODID_CATEGORY_EU_SPECIFIC = 2,
2786 #[doc = "The category for the UA, according to the EU specification, is the Certified category."]
2787 MAV_ODID_CATEGORY_EU_CERTIFIED = 3,
2788}
2789impl MavOdidCategoryEu {
2790 pub const DEFAULT: Self = Self::MAV_ODID_CATEGORY_EU_UNDECLARED;
2791}
2792impl Default for MavOdidCategoryEu {
2793 fn default() -> Self {
2794 Self::DEFAULT
2795 }
2796}
2797#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2798#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2799#[cfg_attr(feature = "serde", serde(tag = "type"))]
2800#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2801#[repr(u32)]
2802pub enum MavOdidClassEu {
2803 #[doc = "The class for the UA, according to the EU specification, is undeclared."]
2804 MAV_ODID_CLASS_EU_UNDECLARED = 0,
2805 #[doc = "The class for the UA, according to the EU specification, is Class 0."]
2806 MAV_ODID_CLASS_EU_CLASS_0 = 1,
2807 #[doc = "The class for the UA, according to the EU specification, is Class 1."]
2808 MAV_ODID_CLASS_EU_CLASS_1 = 2,
2809 #[doc = "The class for the UA, according to the EU specification, is Class 2."]
2810 MAV_ODID_CLASS_EU_CLASS_2 = 3,
2811 #[doc = "The class for the UA, according to the EU specification, is Class 3."]
2812 MAV_ODID_CLASS_EU_CLASS_3 = 4,
2813 #[doc = "The class for the UA, according to the EU specification, is Class 4."]
2814 MAV_ODID_CLASS_EU_CLASS_4 = 5,
2815 #[doc = "The class for the UA, according to the EU specification, is Class 5."]
2816 MAV_ODID_CLASS_EU_CLASS_5 = 6,
2817 #[doc = "The class for the UA, according to the EU specification, is Class 6."]
2818 MAV_ODID_CLASS_EU_CLASS_6 = 7,
2819}
2820impl MavOdidClassEu {
2821 pub const DEFAULT: Self = Self::MAV_ODID_CLASS_EU_UNDECLARED;
2822}
2823impl Default for MavOdidClassEu {
2824 fn default() -> Self {
2825 Self::DEFAULT
2826 }
2827}
2828#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2829#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2830#[cfg_attr(feature = "serde", serde(tag = "type"))]
2831#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2832#[repr(u32)]
2833pub enum MavOdidClassificationType {
2834 #[doc = "The classification type for the UA is undeclared."]
2835 MAV_ODID_CLASSIFICATION_TYPE_UNDECLARED = 0,
2836 #[doc = "The classification type for the UA follows EU (European Union) specifications."]
2837 MAV_ODID_CLASSIFICATION_TYPE_EU = 1,
2838}
2839impl MavOdidClassificationType {
2840 pub const DEFAULT: Self = Self::MAV_ODID_CLASSIFICATION_TYPE_UNDECLARED;
2841}
2842impl Default for MavOdidClassificationType {
2843 fn default() -> Self {
2844 Self::DEFAULT
2845 }
2846}
2847#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2848#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2849#[cfg_attr(feature = "serde", serde(tag = "type"))]
2850#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2851#[repr(u32)]
2852pub enum MavOdidDescType {
2853 #[doc = "Optional free-form text description of the purpose of the flight."]
2854 MAV_ODID_DESC_TYPE_TEXT = 0,
2855 #[doc = "Optional additional clarification when status == MAV_ODID_STATUS_EMERGENCY."]
2856 MAV_ODID_DESC_TYPE_EMERGENCY = 1,
2857 #[doc = "Optional additional clarification when status != MAV_ODID_STATUS_EMERGENCY."]
2858 MAV_ODID_DESC_TYPE_EXTENDED_STATUS = 2,
2859}
2860impl MavOdidDescType {
2861 pub const DEFAULT: Self = Self::MAV_ODID_DESC_TYPE_TEXT;
2862}
2863impl Default for MavOdidDescType {
2864 fn default() -> Self {
2865 Self::DEFAULT
2866 }
2867}
2868#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2869#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2870#[cfg_attr(feature = "serde", serde(tag = "type"))]
2871#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2872#[repr(u32)]
2873pub enum MavOdidHeightRef {
2874 #[doc = "The height field is relative to the take-off location."]
2875 MAV_ODID_HEIGHT_REF_OVER_TAKEOFF = 0,
2876 #[doc = "The height field is relative to ground."]
2877 MAV_ODID_HEIGHT_REF_OVER_GROUND = 1,
2878}
2879impl MavOdidHeightRef {
2880 pub const DEFAULT: Self = Self::MAV_ODID_HEIGHT_REF_OVER_TAKEOFF;
2881}
2882impl Default for MavOdidHeightRef {
2883 fn default() -> Self {
2884 Self::DEFAULT
2885 }
2886}
2887#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2888#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2889#[cfg_attr(feature = "serde", serde(tag = "type"))]
2890#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2891#[repr(u32)]
2892pub enum MavOdidHorAcc {
2893 #[doc = "The horizontal accuracy is unknown."]
2894 MAV_ODID_HOR_ACC_UNKNOWN = 0,
2895 #[doc = "The horizontal accuracy is smaller than 10 Nautical Miles. 18.52 km."]
2896 MAV_ODID_HOR_ACC_10NM = 1,
2897 #[doc = "The horizontal accuracy is smaller than 4 Nautical Miles. 7.408 km."]
2898 MAV_ODID_HOR_ACC_4NM = 2,
2899 #[doc = "The horizontal accuracy is smaller than 2 Nautical Miles. 3.704 km."]
2900 MAV_ODID_HOR_ACC_2NM = 3,
2901 #[doc = "The horizontal accuracy is smaller than 1 Nautical Miles. 1.852 km."]
2902 MAV_ODID_HOR_ACC_1NM = 4,
2903 #[doc = "The horizontal accuracy is smaller than 0.5 Nautical Miles. 926 m."]
2904 MAV_ODID_HOR_ACC_0_5NM = 5,
2905 #[doc = "The horizontal accuracy is smaller than 0.3 Nautical Miles. 555.6 m."]
2906 MAV_ODID_HOR_ACC_0_3NM = 6,
2907 #[doc = "The horizontal accuracy is smaller than 0.1 Nautical Miles. 185.2 m."]
2908 MAV_ODID_HOR_ACC_0_1NM = 7,
2909 #[doc = "The horizontal accuracy is smaller than 0.05 Nautical Miles. 92.6 m."]
2910 MAV_ODID_HOR_ACC_0_05NM = 8,
2911 #[doc = "The horizontal accuracy is smaller than 30 meter."]
2912 MAV_ODID_HOR_ACC_30_METER = 9,
2913 #[doc = "The horizontal accuracy is smaller than 10 meter."]
2914 MAV_ODID_HOR_ACC_10_METER = 10,
2915 #[doc = "The horizontal accuracy is smaller than 3 meter."]
2916 MAV_ODID_HOR_ACC_3_METER = 11,
2917 #[doc = "The horizontal accuracy is smaller than 1 meter."]
2918 MAV_ODID_HOR_ACC_1_METER = 12,
2919}
2920impl MavOdidHorAcc {
2921 pub const DEFAULT: Self = Self::MAV_ODID_HOR_ACC_UNKNOWN;
2922}
2923impl Default for MavOdidHorAcc {
2924 fn default() -> Self {
2925 Self::DEFAULT
2926 }
2927}
2928#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2929#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2930#[cfg_attr(feature = "serde", serde(tag = "type"))]
2931#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2932#[repr(u32)]
2933pub enum MavOdidIdType {
2934 #[doc = "No type defined."]
2935 MAV_ODID_ID_TYPE_NONE = 0,
2936 #[doc = "Manufacturer Serial Number (ANSI/CTA-2063 format)."]
2937 MAV_ODID_ID_TYPE_SERIAL_NUMBER = 1,
2938 #[doc = "CAA (Civil Aviation Authority) registered ID. Format: [ICAO Country Code].[CAA Assigned ID]."]
2939 MAV_ODID_ID_TYPE_CAA_REGISTRATION_ID = 2,
2940 #[doc = "UTM (Unmanned Traffic Management) assigned UUID (RFC4122)."]
2941 MAV_ODID_ID_TYPE_UTM_ASSIGNED_UUID = 3,
2942 #[doc = "A 20 byte ID for a specific flight/session. The exact ID type is indicated by the first byte of uas_id and these type values are managed by ICAO."]
2943 MAV_ODID_ID_TYPE_SPECIFIC_SESSION_ID = 4,
2944}
2945impl MavOdidIdType {
2946 pub const DEFAULT: Self = Self::MAV_ODID_ID_TYPE_NONE;
2947}
2948impl Default for MavOdidIdType {
2949 fn default() -> Self {
2950 Self::DEFAULT
2951 }
2952}
2953#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2954#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2955#[cfg_attr(feature = "serde", serde(tag = "type"))]
2956#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2957#[repr(u32)]
2958pub enum MavOdidOperatorIdType {
2959 #[doc = "CAA (Civil Aviation Authority) registered operator ID."]
2960 MAV_ODID_OPERATOR_ID_TYPE_CAA = 0,
2961}
2962impl MavOdidOperatorIdType {
2963 pub const DEFAULT: Self = Self::MAV_ODID_OPERATOR_ID_TYPE_CAA;
2964}
2965impl Default for MavOdidOperatorIdType {
2966 fn default() -> Self {
2967 Self::DEFAULT
2968 }
2969}
2970#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2971#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2972#[cfg_attr(feature = "serde", serde(tag = "type"))]
2973#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2974#[repr(u32)]
2975pub enum MavOdidOperatorLocationType {
2976 #[doc = "The location/altitude of the operator is the same as the take-off location."]
2977 MAV_ODID_OPERATOR_LOCATION_TYPE_TAKEOFF = 0,
2978 #[doc = "The location/altitude of the operator is dynamic. E.g. based on live GNSS data."]
2979 MAV_ODID_OPERATOR_LOCATION_TYPE_LIVE_GNSS = 1,
2980 #[doc = "The location/altitude of the operator are fixed values."]
2981 MAV_ODID_OPERATOR_LOCATION_TYPE_FIXED = 2,
2982}
2983impl MavOdidOperatorLocationType {
2984 pub const DEFAULT: Self = Self::MAV_ODID_OPERATOR_LOCATION_TYPE_TAKEOFF;
2985}
2986impl Default for MavOdidOperatorLocationType {
2987 fn default() -> Self {
2988 Self::DEFAULT
2989 }
2990}
2991#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
2992#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
2993#[cfg_attr(feature = "serde", serde(tag = "type"))]
2994#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
2995#[repr(u32)]
2996pub enum MavOdidSpeedAcc {
2997 #[doc = "The speed accuracy is unknown."]
2998 MAV_ODID_SPEED_ACC_UNKNOWN = 0,
2999 #[doc = "The speed accuracy is smaller than 10 meters per second."]
3000 MAV_ODID_SPEED_ACC_10_METERS_PER_SECOND = 1,
3001 #[doc = "The speed accuracy is smaller than 3 meters per second."]
3002 MAV_ODID_SPEED_ACC_3_METERS_PER_SECOND = 2,
3003 #[doc = "The speed accuracy is smaller than 1 meters per second."]
3004 MAV_ODID_SPEED_ACC_1_METERS_PER_SECOND = 3,
3005 #[doc = "The speed accuracy is smaller than 0.3 meters per second."]
3006 MAV_ODID_SPEED_ACC_0_3_METERS_PER_SECOND = 4,
3007}
3008impl MavOdidSpeedAcc {
3009 pub const DEFAULT: Self = Self::MAV_ODID_SPEED_ACC_UNKNOWN;
3010}
3011impl Default for MavOdidSpeedAcc {
3012 fn default() -> Self {
3013 Self::DEFAULT
3014 }
3015}
3016#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3017#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3018#[cfg_attr(feature = "serde", serde(tag = "type"))]
3019#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3020#[repr(u32)]
3021pub enum MavOdidStatus {
3022 #[doc = "The status of the (UA) Unmanned Aircraft is undefined."]
3023 MAV_ODID_STATUS_UNDECLARED = 0,
3024 #[doc = "The UA is on the ground."]
3025 MAV_ODID_STATUS_GROUND = 1,
3026 #[doc = "The UA is in the air."]
3027 MAV_ODID_STATUS_AIRBORNE = 2,
3028 #[doc = "The UA is having an emergency."]
3029 MAV_ODID_STATUS_EMERGENCY = 3,
3030 #[doc = "The remote ID system is failing or unreliable in some way."]
3031 MAV_ODID_STATUS_REMOTE_ID_SYSTEM_FAILURE = 4,
3032}
3033impl MavOdidStatus {
3034 pub const DEFAULT: Self = Self::MAV_ODID_STATUS_UNDECLARED;
3035}
3036impl Default for MavOdidStatus {
3037 fn default() -> Self {
3038 Self::DEFAULT
3039 }
3040}
3041#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3042#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3043#[cfg_attr(feature = "serde", serde(tag = "type"))]
3044#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3045#[repr(u32)]
3046pub enum MavOdidTimeAcc {
3047 #[doc = "The timestamp accuracy is unknown."]
3048 MAV_ODID_TIME_ACC_UNKNOWN = 0,
3049 #[doc = "The timestamp accuracy is smaller than or equal to 0.1 second."]
3050 MAV_ODID_TIME_ACC_0_1_SECOND = 1,
3051 #[doc = "The timestamp accuracy is smaller than or equal to 0.2 second."]
3052 MAV_ODID_TIME_ACC_0_2_SECOND = 2,
3053 #[doc = "The timestamp accuracy is smaller than or equal to 0.3 second."]
3054 MAV_ODID_TIME_ACC_0_3_SECOND = 3,
3055 #[doc = "The timestamp accuracy is smaller than or equal to 0.4 second."]
3056 MAV_ODID_TIME_ACC_0_4_SECOND = 4,
3057 #[doc = "The timestamp accuracy is smaller than or equal to 0.5 second."]
3058 MAV_ODID_TIME_ACC_0_5_SECOND = 5,
3059 #[doc = "The timestamp accuracy is smaller than or equal to 0.6 second."]
3060 MAV_ODID_TIME_ACC_0_6_SECOND = 6,
3061 #[doc = "The timestamp accuracy is smaller than or equal to 0.7 second."]
3062 MAV_ODID_TIME_ACC_0_7_SECOND = 7,
3063 #[doc = "The timestamp accuracy is smaller than or equal to 0.8 second."]
3064 MAV_ODID_TIME_ACC_0_8_SECOND = 8,
3065 #[doc = "The timestamp accuracy is smaller than or equal to 0.9 second."]
3066 MAV_ODID_TIME_ACC_0_9_SECOND = 9,
3067 #[doc = "The timestamp accuracy is smaller than or equal to 1.0 second."]
3068 MAV_ODID_TIME_ACC_1_0_SECOND = 10,
3069 #[doc = "The timestamp accuracy is smaller than or equal to 1.1 second."]
3070 MAV_ODID_TIME_ACC_1_1_SECOND = 11,
3071 #[doc = "The timestamp accuracy is smaller than or equal to 1.2 second."]
3072 MAV_ODID_TIME_ACC_1_2_SECOND = 12,
3073 #[doc = "The timestamp accuracy is smaller than or equal to 1.3 second."]
3074 MAV_ODID_TIME_ACC_1_3_SECOND = 13,
3075 #[doc = "The timestamp accuracy is smaller than or equal to 1.4 second."]
3076 MAV_ODID_TIME_ACC_1_4_SECOND = 14,
3077 #[doc = "The timestamp accuracy is smaller than or equal to 1.5 second."]
3078 MAV_ODID_TIME_ACC_1_5_SECOND = 15,
3079}
3080impl MavOdidTimeAcc {
3081 pub const DEFAULT: Self = Self::MAV_ODID_TIME_ACC_UNKNOWN;
3082}
3083impl Default for MavOdidTimeAcc {
3084 fn default() -> Self {
3085 Self::DEFAULT
3086 }
3087}
3088#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3089#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3090#[cfg_attr(feature = "serde", serde(tag = "type"))]
3091#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3092#[repr(u32)]
3093pub enum MavOdidUaType {
3094 #[doc = "No UA (Unmanned Aircraft) type defined."]
3095 MAV_ODID_UA_TYPE_NONE = 0,
3096 #[doc = "Aeroplane/Airplane. Fixed wing."]
3097 MAV_ODID_UA_TYPE_AEROPLANE = 1,
3098 #[doc = "Helicopter or multirotor."]
3099 MAV_ODID_UA_TYPE_HELICOPTER_OR_MULTIROTOR = 2,
3100 #[doc = "Gyroplane."]
3101 MAV_ODID_UA_TYPE_GYROPLANE = 3,
3102 #[doc = "VTOL (Vertical Take-Off and Landing). Fixed wing aircraft that can take off vertically."]
3103 MAV_ODID_UA_TYPE_HYBRID_LIFT = 4,
3104 #[doc = "Ornithopter."]
3105 MAV_ODID_UA_TYPE_ORNITHOPTER = 5,
3106 #[doc = "Glider."]
3107 MAV_ODID_UA_TYPE_GLIDER = 6,
3108 #[doc = "Kite."]
3109 MAV_ODID_UA_TYPE_KITE = 7,
3110 #[doc = "Free Balloon."]
3111 MAV_ODID_UA_TYPE_FREE_BALLOON = 8,
3112 #[doc = "Captive Balloon."]
3113 MAV_ODID_UA_TYPE_CAPTIVE_BALLOON = 9,
3114 #[doc = "Airship. E.g. a blimp."]
3115 MAV_ODID_UA_TYPE_AIRSHIP = 10,
3116 #[doc = "Free Fall/Parachute (unpowered)."]
3117 MAV_ODID_UA_TYPE_FREE_FALL_PARACHUTE = 11,
3118 #[doc = "Rocket."]
3119 MAV_ODID_UA_TYPE_ROCKET = 12,
3120 #[doc = "Tethered powered aircraft."]
3121 MAV_ODID_UA_TYPE_TETHERED_POWERED_AIRCRAFT = 13,
3122 #[doc = "Ground Obstacle."]
3123 MAV_ODID_UA_TYPE_GROUND_OBSTACLE = 14,
3124 #[doc = "Other type of aircraft not listed earlier."]
3125 MAV_ODID_UA_TYPE_OTHER = 15,
3126}
3127impl MavOdidUaType {
3128 pub const DEFAULT: Self = Self::MAV_ODID_UA_TYPE_NONE;
3129}
3130impl Default for MavOdidUaType {
3131 fn default() -> Self {
3132 Self::DEFAULT
3133 }
3134}
3135#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3136#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3137#[cfg_attr(feature = "serde", serde(tag = "type"))]
3138#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3139#[repr(u32)]
3140pub enum MavOdidVerAcc {
3141 #[doc = "The vertical accuracy is unknown."]
3142 MAV_ODID_VER_ACC_UNKNOWN = 0,
3143 #[doc = "The vertical accuracy is smaller than 150 meter."]
3144 MAV_ODID_VER_ACC_150_METER = 1,
3145 #[doc = "The vertical accuracy is smaller than 45 meter."]
3146 MAV_ODID_VER_ACC_45_METER = 2,
3147 #[doc = "The vertical accuracy is smaller than 25 meter."]
3148 MAV_ODID_VER_ACC_25_METER = 3,
3149 #[doc = "The vertical accuracy is smaller than 10 meter."]
3150 MAV_ODID_VER_ACC_10_METER = 4,
3151 #[doc = "The vertical accuracy is smaller than 3 meter."]
3152 MAV_ODID_VER_ACC_3_METER = 5,
3153 #[doc = "The vertical accuracy is smaller than 1 meter."]
3154 MAV_ODID_VER_ACC_1_METER = 6,
3155}
3156impl MavOdidVerAcc {
3157 pub const DEFAULT: Self = Self::MAV_ODID_VER_ACC_UNKNOWN;
3158}
3159impl Default for MavOdidVerAcc {
3160 fn default() -> Self {
3161 Self::DEFAULT
3162 }
3163}
3164#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3165#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3166#[cfg_attr(feature = "serde", serde(tag = "type"))]
3167#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3168#[repr(u32)]
3169#[doc = "Specifies the datatype of a MAVLink extended parameter."]
3170pub enum MavParamExtType {
3171 #[doc = "8-bit unsigned integer"]
3172 MAV_PARAM_EXT_TYPE_UINT8 = 1,
3173 #[doc = "8-bit signed integer"]
3174 MAV_PARAM_EXT_TYPE_INT8 = 2,
3175 #[doc = "16-bit unsigned integer"]
3176 MAV_PARAM_EXT_TYPE_UINT16 = 3,
3177 #[doc = "16-bit signed integer"]
3178 MAV_PARAM_EXT_TYPE_INT16 = 4,
3179 #[doc = "32-bit unsigned integer"]
3180 MAV_PARAM_EXT_TYPE_UINT32 = 5,
3181 #[doc = "32-bit signed integer"]
3182 MAV_PARAM_EXT_TYPE_INT32 = 6,
3183 #[doc = "64-bit unsigned integer"]
3184 MAV_PARAM_EXT_TYPE_UINT64 = 7,
3185 #[doc = "64-bit signed integer"]
3186 MAV_PARAM_EXT_TYPE_INT64 = 8,
3187 #[doc = "32-bit floating-point"]
3188 MAV_PARAM_EXT_TYPE_REAL32 = 9,
3189 #[doc = "64-bit floating-point"]
3190 MAV_PARAM_EXT_TYPE_REAL64 = 10,
3191 #[doc = "Custom Type"]
3192 MAV_PARAM_EXT_TYPE_CUSTOM = 11,
3193}
3194impl MavParamExtType {
3195 pub const DEFAULT: Self = Self::MAV_PARAM_EXT_TYPE_UINT8;
3196}
3197impl Default for MavParamExtType {
3198 fn default() -> Self {
3199 Self::DEFAULT
3200 }
3201}
3202#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3203#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3204#[cfg_attr(feature = "serde", serde(tag = "type"))]
3205#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3206#[repr(u32)]
3207#[doc = "Specifies the datatype of a MAVLink parameter."]
3208pub enum MavParamType {
3209 #[doc = "8-bit unsigned integer"]
3210 MAV_PARAM_TYPE_UINT8 = 1,
3211 #[doc = "8-bit signed integer"]
3212 MAV_PARAM_TYPE_INT8 = 2,
3213 #[doc = "16-bit unsigned integer"]
3214 MAV_PARAM_TYPE_UINT16 = 3,
3215 #[doc = "16-bit signed integer"]
3216 MAV_PARAM_TYPE_INT16 = 4,
3217 #[doc = "32-bit unsigned integer"]
3218 MAV_PARAM_TYPE_UINT32 = 5,
3219 #[doc = "32-bit signed integer"]
3220 MAV_PARAM_TYPE_INT32 = 6,
3221 #[doc = "64-bit unsigned integer"]
3222 MAV_PARAM_TYPE_UINT64 = 7,
3223 #[doc = "64-bit signed integer"]
3224 MAV_PARAM_TYPE_INT64 = 8,
3225 #[doc = "32-bit floating-point"]
3226 MAV_PARAM_TYPE_REAL32 = 9,
3227 #[doc = "64-bit floating-point"]
3228 MAV_PARAM_TYPE_REAL64 = 10,
3229}
3230impl MavParamType {
3231 pub const DEFAULT: Self = Self::MAV_PARAM_TYPE_UINT8;
3232}
3233impl Default for MavParamType {
3234 fn default() -> Self {
3235 Self::DEFAULT
3236 }
3237}
3238bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Power supply status flags (bitmask)"] pub struct MavPowerStatus : u16 { # [doc = "main brick power supply valid"] const MAV_POWER_STATUS_BRICK_VALID = 1 ; # [doc = "main servo power supply valid for FMU"] const MAV_POWER_STATUS_SERVO_VALID = 2 ; # [doc = "USB power is connected"] const MAV_POWER_STATUS_USB_CONNECTED = 4 ; # [doc = "peripheral supply is in over-current state"] const MAV_POWER_STATUS_PERIPH_OVERCURRENT = 8 ; # [doc = "hi-power peripheral supply is in over-current state"] const MAV_POWER_STATUS_PERIPH_HIPOWER_OVERCURRENT = 16 ; # [doc = "Power status has changed since boot"] const MAV_POWER_STATUS_CHANGED = 32 ; } }
3239impl MavPowerStatus {
3240 pub const DEFAULT: Self = Self::MAV_POWER_STATUS_BRICK_VALID;
3241}
3242impl Default for MavPowerStatus {
3243 fn default() -> Self {
3244 Self::DEFAULT
3245 }
3246}
3247bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Bitmask of (optional) autopilot capabilities (64 bit). If a bit is set, the autopilot supports this capability."] pub struct MavProtocolCapability : u64 { # [doc = "Autopilot supports the MISSION_ITEM float message type. Note that MISSION_ITEM is deprecated, and autopilots should use MISSION_INT instead."] const MAV_PROTOCOL_CAPABILITY_MISSION_FLOAT = 1 ; # [deprecated = " See `MAV_PROTOCOL_CAPABILITY_PARAM_ENCODE_C_CAST` (Deprecated since 2022-03)"] # [doc = "Autopilot supports the new param float message type."] const MAV_PROTOCOL_CAPABILITY_PARAM_FLOAT = 2 ; # [doc = "Autopilot supports MISSION_ITEM_INT scaled integer message type. Note that this flag must always be set if missions are supported, because missions must always use MISSION_ITEM_INT (rather than MISSION_ITEM, which is deprecated)."] const MAV_PROTOCOL_CAPABILITY_MISSION_INT = 4 ; # [doc = "Autopilot supports COMMAND_INT scaled integer message type."] const MAV_PROTOCOL_CAPABILITY_COMMAND_INT = 8 ; # [doc = "Parameter protocol uses byte-wise encoding of parameter values into param_value (float) fields: <https://mavlink.io/en/services/parameter.html#parameter-encoding>. Note that either this flag or MAV_PROTOCOL_CAPABILITY_PARAM_ENCODE_C_CAST should be set if the parameter protocol is supported."] const MAV_PROTOCOL_CAPABILITY_PARAM_ENCODE_BYTEWISE = 16 ; # [doc = "Autopilot supports the File Transfer Protocol v1: <https://mavlink.io/en/services/ftp.html>."] const MAV_PROTOCOL_CAPABILITY_FTP = 32 ; # [doc = "Autopilot supports commanding attitude offboard."] const MAV_PROTOCOL_CAPABILITY_SET_ATTITUDE_TARGET = 64 ; # [doc = "Autopilot supports commanding position and velocity targets in local NED frame."] const MAV_PROTOCOL_CAPABILITY_SET_POSITION_TARGET_LOCAL_NED = 128 ; # [doc = "Autopilot supports commanding position and velocity targets in global scaled integers."] const MAV_PROTOCOL_CAPABILITY_SET_POSITION_TARGET_GLOBAL_INT = 256 ; # [doc = "Autopilot supports terrain protocol / data handling."] const MAV_PROTOCOL_CAPABILITY_TERRAIN = 512 ; # [doc = "Reserved for future use."] const MAV_PROTOCOL_CAPABILITY_RESERVED3 = 1024 ; # [doc = "Autopilot supports the MAV_CMD_DO_FLIGHTTERMINATION command (flight termination)."] const MAV_PROTOCOL_CAPABILITY_FLIGHT_TERMINATION = 2048 ; # [doc = "Autopilot supports onboard compass calibration."] const MAV_PROTOCOL_CAPABILITY_COMPASS_CALIBRATION = 4096 ; # [doc = "Autopilot supports MAVLink version 2."] const MAV_PROTOCOL_CAPABILITY_MAVLINK2 = 8192 ; # [doc = "Autopilot supports mission fence protocol."] const MAV_PROTOCOL_CAPABILITY_MISSION_FENCE = 16384 ; # [doc = "Autopilot supports mission rally point protocol."] const MAV_PROTOCOL_CAPABILITY_MISSION_RALLY = 32768 ; # [doc = "Reserved for future use."] const MAV_PROTOCOL_CAPABILITY_RESERVED2 = 65536 ; # [doc = "Parameter protocol uses C-cast of parameter values to set the param_value (float) fields: <https://mavlink.io/en/services/parameter.html#parameter-encoding>. Note that either this flag or MAV_PROTOCOL_CAPABILITY_PARAM_ENCODE_BYTEWISE should be set if the parameter protocol is supported."] const MAV_PROTOCOL_CAPABILITY_PARAM_ENCODE_C_CAST = 131072 ; # [doc = "This component implements/is a gimbal manager. This means the GIMBAL_MANAGER_INFORMATION, and other messages can be requested."] const MAV_PROTOCOL_CAPABILITY_COMPONENT_IMPLEMENTS_GIMBAL_MANAGER = 262144 ; # [doc = "Component supports locking control to a particular GCS independent of its system (via MAV_CMD_REQUEST_OPERATOR_CONTROL)."] const MAV_PROTOCOL_CAPABILITY_COMPONENT_ACCEPTS_GCS_CONTROL = 524288 ; } }
3248impl MavProtocolCapability {
3249 pub const DEFAULT: Self = Self::MAV_PROTOCOL_CAPABILITY_MISSION_FLOAT;
3250}
3251impl Default for MavProtocolCapability {
3252 fn default() -> Self {
3253 Self::DEFAULT
3254 }
3255}
3256#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3257#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3258#[cfg_attr(feature = "serde", serde(tag = "type"))]
3259#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3260#[repr(u32)]
3261#[doc = "Result from a MAVLink command (MAV_CMD)"]
3262pub enum MavResult {
3263 #[doc = "Command is valid (is supported and has valid parameters), and was executed."]
3264 MAV_RESULT_ACCEPTED = 0,
3265 #[doc = "Command is valid, but cannot be executed at this time. This is used to indicate a problem that should be fixed just by waiting (e.g. a state machine is busy, can't arm because have not got GPS lock, etc.). Retrying later should work."]
3266 MAV_RESULT_TEMPORARILY_REJECTED = 1,
3267 #[doc = "Command is invalid (is supported but has invalid parameters). Retrying same command and parameters will not work."]
3268 MAV_RESULT_DENIED = 2,
3269 #[doc = "Command is not supported (unknown)."]
3270 MAV_RESULT_UNSUPPORTED = 3,
3271 #[doc = "Command is valid, but execution has failed. This is used to indicate any non-temporary or unexpected problem, i.e. any problem that must be fixed before the command can succeed/be retried. For example, attempting to write a file when out of memory, attempting to arm when sensors are not calibrated, etc."]
3272 MAV_RESULT_FAILED = 4,
3273 #[doc = "Command is valid and is being executed. This will be followed by further progress updates, i.e. the component may send further COMMAND_ACK messages with result MAV_RESULT_IN_PROGRESS (at a rate decided by the implementation), and must terminate by sending a COMMAND_ACK message with final result of the operation. The COMMAND_ACK.progress field can be used to indicate the progress of the operation."]
3274 MAV_RESULT_IN_PROGRESS = 5,
3275 #[doc = "Command has been cancelled (as a result of receiving a COMMAND_CANCEL message)."]
3276 MAV_RESULT_CANCELLED = 6,
3277 #[doc = "Command is only accepted when sent as a COMMAND_LONG."]
3278 MAV_RESULT_COMMAND_LONG_ONLY = 7,
3279 #[doc = "Command is only accepted when sent as a COMMAND_INT."]
3280 MAV_RESULT_COMMAND_INT_ONLY = 8,
3281 #[doc = "Command is invalid because a frame is required and the specified frame is not supported."]
3282 MAV_RESULT_COMMAND_UNSUPPORTED_MAV_FRAME = 9,
3283}
3284impl MavResult {
3285 pub const DEFAULT: Self = Self::MAV_RESULT_ACCEPTED;
3286}
3287impl Default for MavResult {
3288 fn default() -> Self {
3289 Self::DEFAULT
3290 }
3291}
3292#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3293#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3294#[cfg_attr(feature = "serde", serde(tag = "type"))]
3295#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3296#[repr(u32)]
3297#[deprecated = " See `MAV_CMD_DO_SET_ROI_*` (Deprecated since 2018-01)"]
3298#[doc = "The ROI (region of interest) for the vehicle. This can be be used by the vehicle for camera/vehicle attitude alignment (see MAV_CMD_NAV_ROI)."]
3299pub enum MavRoi {
3300 #[doc = "No region of interest."]
3301 MAV_ROI_NONE = 0,
3302 #[doc = "Point toward next waypoint, with optional pitch/roll/yaw offset."]
3303 MAV_ROI_WPNEXT = 1,
3304 #[doc = "Point toward given waypoint."]
3305 MAV_ROI_WPINDEX = 2,
3306 #[doc = "Point toward fixed location."]
3307 MAV_ROI_LOCATION = 3,
3308 #[doc = "Point toward of given id."]
3309 MAV_ROI_TARGET = 4,
3310}
3311impl MavRoi {
3312 pub const DEFAULT: Self = Self::MAV_ROI_NONE;
3313}
3314impl Default for MavRoi {
3315 fn default() -> Self {
3316 Self::DEFAULT
3317 }
3318}
3319#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3320#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3321#[cfg_attr(feature = "serde", serde(tag = "type"))]
3322#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3323#[repr(u32)]
3324#[doc = "Enumeration of sensor orientation, according to its rotations"]
3325pub enum MavSensorOrientation {
3326 #[doc = "Roll: 0, Pitch: 0, Yaw: 0"]
3327 MAV_SENSOR_ROTATION_NONE = 0,
3328 #[doc = "Roll: 0, Pitch: 0, Yaw: 45"]
3329 MAV_SENSOR_ROTATION_YAW_45 = 1,
3330 #[doc = "Roll: 0, Pitch: 0, Yaw: 90"]
3331 MAV_SENSOR_ROTATION_YAW_90 = 2,
3332 #[doc = "Roll: 0, Pitch: 0, Yaw: 135"]
3333 MAV_SENSOR_ROTATION_YAW_135 = 3,
3334 #[doc = "Roll: 0, Pitch: 0, Yaw: 180"]
3335 MAV_SENSOR_ROTATION_YAW_180 = 4,
3336 #[doc = "Roll: 0, Pitch: 0, Yaw: 225"]
3337 MAV_SENSOR_ROTATION_YAW_225 = 5,
3338 #[doc = "Roll: 0, Pitch: 0, Yaw: 270"]
3339 MAV_SENSOR_ROTATION_YAW_270 = 6,
3340 #[doc = "Roll: 0, Pitch: 0, Yaw: 315"]
3341 MAV_SENSOR_ROTATION_YAW_315 = 7,
3342 #[doc = "Roll: 180, Pitch: 0, Yaw: 0"]
3343 MAV_SENSOR_ROTATION_ROLL_180 = 8,
3344 #[doc = "Roll: 180, Pitch: 0, Yaw: 45"]
3345 MAV_SENSOR_ROTATION_ROLL_180_YAW_45 = 9,
3346 #[doc = "Roll: 180, Pitch: 0, Yaw: 90"]
3347 MAV_SENSOR_ROTATION_ROLL_180_YAW_90 = 10,
3348 #[doc = "Roll: 180, Pitch: 0, Yaw: 135"]
3349 MAV_SENSOR_ROTATION_ROLL_180_YAW_135 = 11,
3350 #[doc = "Roll: 0, Pitch: 180, Yaw: 0"]
3351 MAV_SENSOR_ROTATION_PITCH_180 = 12,
3352 #[doc = "Roll: 180, Pitch: 0, Yaw: 225"]
3353 MAV_SENSOR_ROTATION_ROLL_180_YAW_225 = 13,
3354 #[doc = "Roll: 180, Pitch: 0, Yaw: 270"]
3355 MAV_SENSOR_ROTATION_ROLL_180_YAW_270 = 14,
3356 #[doc = "Roll: 180, Pitch: 0, Yaw: 315"]
3357 MAV_SENSOR_ROTATION_ROLL_180_YAW_315 = 15,
3358 #[doc = "Roll: 90, Pitch: 0, Yaw: 0"]
3359 MAV_SENSOR_ROTATION_ROLL_90 = 16,
3360 #[doc = "Roll: 90, Pitch: 0, Yaw: 45"]
3361 MAV_SENSOR_ROTATION_ROLL_90_YAW_45 = 17,
3362 #[doc = "Roll: 90, Pitch: 0, Yaw: 90"]
3363 MAV_SENSOR_ROTATION_ROLL_90_YAW_90 = 18,
3364 #[doc = "Roll: 90, Pitch: 0, Yaw: 135"]
3365 MAV_SENSOR_ROTATION_ROLL_90_YAW_135 = 19,
3366 #[doc = "Roll: 270, Pitch: 0, Yaw: 0"]
3367 MAV_SENSOR_ROTATION_ROLL_270 = 20,
3368 #[doc = "Roll: 270, Pitch: 0, Yaw: 45"]
3369 MAV_SENSOR_ROTATION_ROLL_270_YAW_45 = 21,
3370 #[doc = "Roll: 270, Pitch: 0, Yaw: 90"]
3371 MAV_SENSOR_ROTATION_ROLL_270_YAW_90 = 22,
3372 #[doc = "Roll: 270, Pitch: 0, Yaw: 135"]
3373 MAV_SENSOR_ROTATION_ROLL_270_YAW_135 = 23,
3374 #[doc = "Roll: 0, Pitch: 90, Yaw: 0"]
3375 MAV_SENSOR_ROTATION_PITCH_90 = 24,
3376 #[doc = "Roll: 0, Pitch: 270, Yaw: 0"]
3377 MAV_SENSOR_ROTATION_PITCH_270 = 25,
3378 #[doc = "Roll: 0, Pitch: 180, Yaw: 90"]
3379 MAV_SENSOR_ROTATION_PITCH_180_YAW_90 = 26,
3380 #[doc = "Roll: 0, Pitch: 180, Yaw: 270"]
3381 MAV_SENSOR_ROTATION_PITCH_180_YAW_270 = 27,
3382 #[doc = "Roll: 90, Pitch: 90, Yaw: 0"]
3383 MAV_SENSOR_ROTATION_ROLL_90_PITCH_90 = 28,
3384 #[doc = "Roll: 180, Pitch: 90, Yaw: 0"]
3385 MAV_SENSOR_ROTATION_ROLL_180_PITCH_90 = 29,
3386 #[doc = "Roll: 270, Pitch: 90, Yaw: 0"]
3387 MAV_SENSOR_ROTATION_ROLL_270_PITCH_90 = 30,
3388 #[doc = "Roll: 90, Pitch: 180, Yaw: 0"]
3389 MAV_SENSOR_ROTATION_ROLL_90_PITCH_180 = 31,
3390 #[doc = "Roll: 270, Pitch: 180, Yaw: 0"]
3391 MAV_SENSOR_ROTATION_ROLL_270_PITCH_180 = 32,
3392 #[doc = "Roll: 90, Pitch: 270, Yaw: 0"]
3393 MAV_SENSOR_ROTATION_ROLL_90_PITCH_270 = 33,
3394 #[doc = "Roll: 180, Pitch: 270, Yaw: 0"]
3395 MAV_SENSOR_ROTATION_ROLL_180_PITCH_270 = 34,
3396 #[doc = "Roll: 270, Pitch: 270, Yaw: 0"]
3397 MAV_SENSOR_ROTATION_ROLL_270_PITCH_270 = 35,
3398 #[doc = "Roll: 90, Pitch: 180, Yaw: 90"]
3399 MAV_SENSOR_ROTATION_ROLL_90_PITCH_180_YAW_90 = 36,
3400 #[doc = "Roll: 90, Pitch: 0, Yaw: 270"]
3401 MAV_SENSOR_ROTATION_ROLL_90_YAW_270 = 37,
3402 #[doc = "Roll: 90, Pitch: 68, Yaw: 293"]
3403 MAV_SENSOR_ROTATION_ROLL_90_PITCH_68_YAW_293 = 38,
3404 #[doc = "Pitch: 315"]
3405 MAV_SENSOR_ROTATION_PITCH_315 = 39,
3406 #[doc = "Roll: 90, Pitch: 315"]
3407 MAV_SENSOR_ROTATION_ROLL_90_PITCH_315 = 40,
3408 #[doc = "Custom orientation"]
3409 MAV_SENSOR_ROTATION_CUSTOM = 100,
3410}
3411impl MavSensorOrientation {
3412 pub const DEFAULT: Self = Self::MAV_SENSOR_ROTATION_NONE;
3413}
3414impl Default for MavSensorOrientation {
3415 fn default() -> Self {
3416 Self::DEFAULT
3417 }
3418}
3419#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3420#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3421#[cfg_attr(feature = "serde", serde(tag = "type"))]
3422#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3423#[repr(u32)]
3424#[doc = "Indicates the severity level, generally used for status messages to indicate their relative urgency. Based on RFC-5424 using expanded definitions at: <http://www.kiwisyslog.com/kb/info:-syslog-message-levels/>."]
3425pub enum MavSeverity {
3426 #[doc = "System is unusable. This is a \"panic\" condition."]
3427 MAV_SEVERITY_EMERGENCY = 0,
3428 #[doc = "Action should be taken immediately. Indicates error in non-critical systems."]
3429 MAV_SEVERITY_ALERT = 1,
3430 #[doc = "Action must be taken immediately. Indicates failure in a primary system."]
3431 MAV_SEVERITY_CRITICAL = 2,
3432 #[doc = "Indicates an error in secondary/redundant systems."]
3433 MAV_SEVERITY_ERROR = 3,
3434 #[doc = "Indicates about a possible future error if this is not resolved within a given timeframe. Example would be a low battery warning."]
3435 MAV_SEVERITY_WARNING = 4,
3436 #[doc = "An unusual event has occurred, though not an error condition. This should be investigated for the root cause."]
3437 MAV_SEVERITY_NOTICE = 5,
3438 #[doc = "Normal operational messages. Useful for logging. No action is required for these messages."]
3439 MAV_SEVERITY_INFO = 6,
3440 #[doc = "Useful non-operational messages that can assist in debugging. These should not occur during normal operation."]
3441 MAV_SEVERITY_DEBUG = 7,
3442}
3443impl MavSeverity {
3444 pub const DEFAULT: Self = Self::MAV_SEVERITY_EMERGENCY;
3445}
3446impl Default for MavSeverity {
3447 fn default() -> Self {
3448 Self::DEFAULT
3449 }
3450}
3451#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3452#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3453#[cfg_attr(feature = "serde", serde(tag = "type"))]
3454#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3455#[repr(u32)]
3456#[doc = "Standard modes with a well understood meaning across flight stacks and vehicle types. For example, most flight stack have the concept of a \"return\" or \"RTL\" mode that takes a vehicle to safety, even though the precise mechanics of this mode may differ. The modes supported by a flight stack can be queried using AVAILABLE_MODES and set using MAV_CMD_DO_SET_STANDARD_MODE. The current mode is streamed in CURRENT_MODE. See <https://mavlink.io/en/services/standard_modes.html>"]
3457pub enum MavStandardMode {
3458 #[doc = "Non standard mode. This may be used when reporting the mode if the current flight mode is not a standard mode."]
3459 MAV_STANDARD_MODE_NON_STANDARD = 0,
3460 #[doc = "Position mode (manual). Position-controlled and stabilized manual mode. When sticks are released vehicles return to their level-flight orientation and hold both position and altitude against wind and external forces. This mode can only be set by vehicles that can hold a fixed position. Multicopter (MC) vehicles actively brake and hold both position and altitude against wind and external forces. Hybrid MC/FW (\"VTOL\") vehicles first transition to multicopter mode (if needed) but otherwise behave in the same way as MC vehicles. Fixed-wing (FW) vehicles must not support this mode. Other vehicle types must not support this mode (this may be revisited through the PR process)."]
3461 MAV_STANDARD_MODE_POSITION_HOLD = 1,
3462 #[doc = "Orbit (manual). Position-controlled and stabilized manual mode. The vehicle circles around a fixed setpoint in the horizontal plane at a particular radius, altitude, and direction. Flight stacks may further allow manual control over the setpoint position, radius, direction, speed, and/or altitude of the circle, but this is not mandated. Flight stacks may support the [MAV_CMD_DO_ORBIT](<https://mavlink.io/en/messages/common.html#MAV_CMD_DO_ORBIT>) for changing the orbit parameters. MC and FW vehicles may support this mode. Hybrid MC/FW (\"VTOL\") vehicles may support this mode in MC/FW or both modes; if the mode is not supported by the current configuration the vehicle should transition to the supported configuration. Other vehicle types must not support this mode (this may be revisited through the PR process)."]
3463 MAV_STANDARD_MODE_ORBIT = 2,
3464 #[doc = "Cruise mode (manual). Position-controlled and stabilized manual mode. When sticks are released vehicles return to their level-flight orientation and hold their original track against wind and external forces. Fixed-wing (FW) vehicles level orientation and maintain current track and altitude against wind and external forces. Hybrid MC/FW (\"VTOL\") vehicles first transition to FW mode (if needed) but otherwise behave in the same way as MC vehicles. Multicopter (MC) vehicles must not support this mode. Other vehicle types must not support this mode (this may be revisited through the PR process)."]
3465 MAV_STANDARD_MODE_CRUISE = 3,
3466 #[doc = "Altitude hold (manual). Altitude-controlled and stabilized manual mode. When sticks are released vehicles return to their level-flight orientation and hold their altitude. MC vehicles continue with existing momentum and may move with wind (or other external forces). FW vehicles continue with current heading, but may be moved off-track by wind. Hybrid MC/FW (\"VTOL\") vehicles behave according to their current configuration/mode (FW or MC). Other vehicle types must not support this mode (this may be revisited through the PR process)."]
3467 MAV_STANDARD_MODE_ALTITUDE_HOLD = 4,
3468 #[doc = "Safe recovery mode (auto). Automatic mode that takes vehicle to a predefined safe location via a safe flight path, and may also automatically land the vehicle. This mode is more commonly referred to as RTL and/or or Smart RTL. The precise return location, flight path, and landing behaviour depend on vehicle configuration and type. For example, the vehicle might return to the home/launch location, a rally point, or the start of a mission landing, it might follow a direct path, mission path, or breadcrumb path, and land using a mission landing pattern or some other kind of descent."]
3469 MAV_STANDARD_MODE_SAFE_RECOVERY = 5,
3470 #[doc = "Mission mode (automatic). Automatic mode that executes MAVLink missions. Missions are executed from the current waypoint as soon as the mode is enabled."]
3471 MAV_STANDARD_MODE_MISSION = 6,
3472 #[doc = "Land mode (auto). Automatic mode that lands the vehicle at the current location. The precise landing behaviour depends on vehicle configuration and type."]
3473 MAV_STANDARD_MODE_LAND = 7,
3474 #[doc = "Takeoff mode (auto). Automatic takeoff mode. The precise takeoff behaviour depends on vehicle configuration and type."]
3475 MAV_STANDARD_MODE_TAKEOFF = 8,
3476}
3477impl MavStandardMode {
3478 pub const DEFAULT: Self = Self::MAV_STANDARD_MODE_NON_STANDARD;
3479}
3480impl Default for MavStandardMode {
3481 fn default() -> Self {
3482 Self::DEFAULT
3483 }
3484}
3485#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3486#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3487#[cfg_attr(feature = "serde", serde(tag = "type"))]
3488#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3489#[repr(u32)]
3490pub enum MavState {
3491 #[doc = "Uninitialized system, state is unknown."]
3492 MAV_STATE_UNINIT = 0,
3493 #[doc = "System is booting up."]
3494 MAV_STATE_BOOT = 1,
3495 #[doc = "System is calibrating and not flight-ready."]
3496 MAV_STATE_CALIBRATING = 2,
3497 #[doc = "System is grounded and on standby. It can be launched any time."]
3498 MAV_STATE_STANDBY = 3,
3499 #[doc = "System is active and might be already airborne. Motors are engaged."]
3500 MAV_STATE_ACTIVE = 4,
3501 #[doc = "System is in a non-normal flight mode (failsafe). It can however still navigate."]
3502 MAV_STATE_CRITICAL = 5,
3503 #[doc = "System is in a non-normal flight mode (failsafe). It lost control over parts or over the whole airframe. It is in mayday and going down."]
3504 MAV_STATE_EMERGENCY = 6,
3505 #[doc = "System just initialized its power-down sequence, will shut down now."]
3506 MAV_STATE_POWEROFF = 7,
3507 #[doc = "System is terminating itself (failsafe or commanded)."]
3508 MAV_STATE_FLIGHT_TERMINATION = 8,
3509}
3510impl MavState {
3511 pub const DEFAULT: Self = Self::MAV_STATE_UNINIT;
3512}
3513impl Default for MavState {
3514 fn default() -> Self {
3515 Self::DEFAULT
3516 }
3517}
3518bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "These encode the sensors whose status is sent as part of the SYS_STATUS message."] pub struct MavSysStatusSensor : u32 { # [doc = "0x01 3D gyro"] const MAV_SYS_STATUS_SENSOR_3D_GYRO = 1 ; # [doc = "0x02 3D accelerometer"] const MAV_SYS_STATUS_SENSOR_3D_ACCEL = 2 ; # [doc = "0x04 3D magnetometer"] const MAV_SYS_STATUS_SENSOR_3D_MAG = 4 ; # [doc = "0x08 absolute pressure"] const MAV_SYS_STATUS_SENSOR_ABSOLUTE_PRESSURE = 8 ; # [doc = "0x10 differential pressure"] const MAV_SYS_STATUS_SENSOR_DIFFERENTIAL_PRESSURE = 16 ; # [doc = "0x20 GPS"] const MAV_SYS_STATUS_SENSOR_GPS = 32 ; # [doc = "0x40 optical flow"] const MAV_SYS_STATUS_SENSOR_OPTICAL_FLOW = 64 ; # [doc = "0x80 computer vision position"] const MAV_SYS_STATUS_SENSOR_VISION_POSITION = 128 ; # [doc = "0x100 laser based position"] const MAV_SYS_STATUS_SENSOR_LASER_POSITION = 256 ; # [doc = "0x200 external ground truth (Vicon or Leica)"] const MAV_SYS_STATUS_SENSOR_EXTERNAL_GROUND_TRUTH = 512 ; # [doc = "0x400 3D angular rate control"] const MAV_SYS_STATUS_SENSOR_ANGULAR_RATE_CONTROL = 1024 ; # [doc = "0x800 attitude stabilization"] const MAV_SYS_STATUS_SENSOR_ATTITUDE_STABILIZATION = 2048 ; # [doc = "0x1000 yaw position"] const MAV_SYS_STATUS_SENSOR_YAW_POSITION = 4096 ; # [doc = "0x2000 z/altitude control"] const MAV_SYS_STATUS_SENSOR_Z_ALTITUDE_CONTROL = 8192 ; # [doc = "0x4000 x/y position control"] const MAV_SYS_STATUS_SENSOR_XY_POSITION_CONTROL = 16384 ; # [doc = "0x8000 motor outputs / control"] const MAV_SYS_STATUS_SENSOR_MOTOR_OUTPUTS = 32768 ; # [doc = "0x10000 RC receiver"] const MAV_SYS_STATUS_SENSOR_RC_RECEIVER = 65536 ; # [doc = "0x20000 2nd 3D gyro"] const MAV_SYS_STATUS_SENSOR_3D_GYRO2 = 131072 ; # [doc = "0x40000 2nd 3D accelerometer"] const MAV_SYS_STATUS_SENSOR_3D_ACCEL2 = 262144 ; # [doc = "0x80000 2nd 3D magnetometer"] const MAV_SYS_STATUS_SENSOR_3D_MAG2 = 524288 ; # [doc = "0x100000 geofence"] const MAV_SYS_STATUS_GEOFENCE = 1048576 ; # [doc = "0x200000 AHRS subsystem health"] const MAV_SYS_STATUS_AHRS = 2097152 ; # [doc = "0x400000 Terrain subsystem health"] const MAV_SYS_STATUS_TERRAIN = 4194304 ; # [doc = "0x800000 Motors are reversed"] const MAV_SYS_STATUS_REVERSE_MOTOR = 8388608 ; # [doc = "0x1000000 Logging"] const MAV_SYS_STATUS_LOGGING = 16777216 ; # [doc = "0x2000000 Battery"] const MAV_SYS_STATUS_SENSOR_BATTERY = 33554432 ; # [doc = "0x4000000 Proximity"] const MAV_SYS_STATUS_SENSOR_PROXIMITY = 67108864 ; # [doc = "0x8000000 Satellite Communication"] const MAV_SYS_STATUS_SENSOR_SATCOM = 134217728 ; # [doc = "0x10000000 pre-arm check status. Always healthy when armed"] const MAV_SYS_STATUS_PREARM_CHECK = 268435456 ; # [doc = "0x20000000 Avoidance/collision prevention"] const MAV_SYS_STATUS_OBSTACLE_AVOIDANCE = 536870912 ; # [doc = "0x40000000 propulsion (actuator, esc, motor or propellor)"] const MAV_SYS_STATUS_SENSOR_PROPULSION = 1073741824 ; # [doc = "0x80000000 Extended bit-field are used for further sensor status bits (needs to be set in onboard_control_sensors_present only)"] const MAV_SYS_STATUS_EXTENSION_USED = 2147483648 ; } }
3519impl MavSysStatusSensor {
3520 pub const DEFAULT: Self = Self::MAV_SYS_STATUS_SENSOR_3D_GYRO;
3521}
3522impl Default for MavSysStatusSensor {
3523 fn default() -> Self {
3524 Self::DEFAULT
3525 }
3526}
3527bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "These encode the sensors whose status is sent as part of the SYS_STATUS message in the extended fields."] pub struct MavSysStatusSensorExtended : u32 { # [doc = "0x01 Recovery system (parachute, balloon, retracts etc)"] const MAV_SYS_STATUS_RECOVERY_SYSTEM = 1 ; } }
3528impl MavSysStatusSensorExtended {
3529 pub const DEFAULT: Self = Self::MAV_SYS_STATUS_RECOVERY_SYSTEM;
3530}
3531impl Default for MavSysStatusSensorExtended {
3532 fn default() -> Self {
3533 Self::DEFAULT
3534 }
3535}
3536#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3537#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3538#[cfg_attr(feature = "serde", serde(tag = "type"))]
3539#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3540#[repr(u32)]
3541pub enum MavTunnelPayloadType {
3542 #[doc = "Encoding of payload unknown."]
3543 MAV_TUNNEL_PAYLOAD_TYPE_UNKNOWN = 0,
3544 #[doc = "Registered for STorM32 gimbal controller."]
3545 MAV_TUNNEL_PAYLOAD_TYPE_STORM32_RESERVED0 = 200,
3546 #[doc = "Registered for STorM32 gimbal controller."]
3547 MAV_TUNNEL_PAYLOAD_TYPE_STORM32_RESERVED1 = 201,
3548 #[doc = "Registered for STorM32 gimbal controller."]
3549 MAV_TUNNEL_PAYLOAD_TYPE_STORM32_RESERVED2 = 202,
3550 #[doc = "Registered for STorM32 gimbal controller."]
3551 MAV_TUNNEL_PAYLOAD_TYPE_STORM32_RESERVED3 = 203,
3552 #[doc = "Registered for STorM32 gimbal controller."]
3553 MAV_TUNNEL_PAYLOAD_TYPE_STORM32_RESERVED4 = 204,
3554 #[doc = "Registered for STorM32 gimbal controller."]
3555 MAV_TUNNEL_PAYLOAD_TYPE_STORM32_RESERVED5 = 205,
3556 #[doc = "Registered for STorM32 gimbal controller."]
3557 MAV_TUNNEL_PAYLOAD_TYPE_STORM32_RESERVED6 = 206,
3558 #[doc = "Registered for STorM32 gimbal controller."]
3559 MAV_TUNNEL_PAYLOAD_TYPE_STORM32_RESERVED7 = 207,
3560 #[doc = "Registered for STorM32 gimbal controller."]
3561 MAV_TUNNEL_PAYLOAD_TYPE_STORM32_RESERVED8 = 208,
3562 #[doc = "Registered for STorM32 gimbal controller."]
3563 MAV_TUNNEL_PAYLOAD_TYPE_STORM32_RESERVED9 = 209,
3564 #[doc = "Registered for ModalAI remote OSD protocol."]
3565 MAV_TUNNEL_PAYLOAD_TYPE_MODALAI_REMOTE_OSD = 210,
3566 #[doc = "Registered for ModalAI ESC UART passthru protocol."]
3567 MAV_TUNNEL_PAYLOAD_TYPE_MODALAI_ESC_UART_PASSTHRU = 211,
3568 #[doc = "Registered for ModalAI vendor use."]
3569 MAV_TUNNEL_PAYLOAD_TYPE_MODALAI_IO_UART_PASSTHRU = 212,
3570}
3571impl MavTunnelPayloadType {
3572 pub const DEFAULT: Self = Self::MAV_TUNNEL_PAYLOAD_TYPE_UNKNOWN;
3573}
3574impl Default for MavTunnelPayloadType {
3575 fn default() -> Self {
3576 Self::DEFAULT
3577 }
3578}
3579#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3580#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3581#[cfg_attr(feature = "serde", serde(tag = "type"))]
3582#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3583#[repr(u32)]
3584#[doc = "MAVLINK component type reported in HEARTBEAT message. Flight controllers must report the type of the vehicle on which they are mounted (e.g. MAV_TYPE_OCTOROTOR). All other components must report a value appropriate for their type (e.g. a camera must use MAV_TYPE_CAMERA)."]
3585pub enum MavType {
3586 #[doc = "Generic micro air vehicle"]
3587 MAV_TYPE_GENERIC = 0,
3588 #[doc = "Fixed wing aircraft."]
3589 MAV_TYPE_FIXED_WING = 1,
3590 #[doc = "Quadrotor"]
3591 MAV_TYPE_QUADROTOR = 2,
3592 #[doc = "Coaxial helicopter"]
3593 MAV_TYPE_COAXIAL = 3,
3594 #[doc = "Normal helicopter with tail rotor."]
3595 MAV_TYPE_HELICOPTER = 4,
3596 #[doc = "Ground installation"]
3597 MAV_TYPE_ANTENNA_TRACKER = 5,
3598 #[doc = "Operator control unit / ground control station"]
3599 MAV_TYPE_GCS = 6,
3600 #[doc = "Airship, controlled"]
3601 MAV_TYPE_AIRSHIP = 7,
3602 #[doc = "Free balloon, uncontrolled"]
3603 MAV_TYPE_FREE_BALLOON = 8,
3604 #[doc = "Rocket"]
3605 MAV_TYPE_ROCKET = 9,
3606 #[doc = "Ground rover"]
3607 MAV_TYPE_GROUND_ROVER = 10,
3608 #[doc = "Surface vessel, boat, ship"]
3609 MAV_TYPE_SURFACE_BOAT = 11,
3610 #[doc = "Submarine"]
3611 MAV_TYPE_SUBMARINE = 12,
3612 #[doc = "Hexarotor"]
3613 MAV_TYPE_HEXAROTOR = 13,
3614 #[doc = "Octorotor"]
3615 MAV_TYPE_OCTOROTOR = 14,
3616 #[doc = "Tricopter"]
3617 MAV_TYPE_TRICOPTER = 15,
3618 #[doc = "Flapping wing"]
3619 MAV_TYPE_FLAPPING_WING = 16,
3620 #[doc = "Kite"]
3621 MAV_TYPE_KITE = 17,
3622 #[doc = "Onboard companion controller"]
3623 MAV_TYPE_ONBOARD_CONTROLLER = 18,
3624 #[doc = "Two-rotor Tailsitter VTOL that additionally uses control surfaces in vertical operation. Note, value previously named MAV_TYPE_VTOL_DUOROTOR."]
3625 MAV_TYPE_VTOL_TAILSITTER_DUOROTOR = 19,
3626 #[doc = "Quad-rotor Tailsitter VTOL using a V-shaped quad config in vertical operation. Note: value previously named MAV_TYPE_VTOL_QUADROTOR."]
3627 MAV_TYPE_VTOL_TAILSITTER_QUADROTOR = 20,
3628 #[doc = "Tiltrotor VTOL. Fuselage and wings stay (nominally) horizontal in all flight phases. It able to tilt (some) rotors to provide thrust in cruise flight."]
3629 MAV_TYPE_VTOL_TILTROTOR = 21,
3630 #[doc = "VTOL with separate fixed rotors for hover and cruise flight. Fuselage and wings stay (nominally) horizontal in all flight phases."]
3631 MAV_TYPE_VTOL_FIXEDROTOR = 22,
3632 #[doc = "Tailsitter VTOL. Fuselage and wings orientation changes depending on flight phase: vertical for hover, horizontal for cruise. Use more specific VTOL MAV_TYPE_VTOL_TAILSITTER_DUOROTOR or MAV_TYPE_VTOL_TAILSITTER_QUADROTOR if appropriate."]
3633 MAV_TYPE_VTOL_TAILSITTER = 23,
3634 #[doc = "Tiltwing VTOL. Fuselage stays horizontal in all flight phases. The whole wing, along with any attached engine, can tilt between vertical and horizontal mode."]
3635 MAV_TYPE_VTOL_TILTWING = 24,
3636 #[doc = "VTOL reserved 5"]
3637 MAV_TYPE_VTOL_RESERVED5 = 25,
3638 #[doc = "Gimbal"]
3639 MAV_TYPE_GIMBAL = 26,
3640 #[doc = "ADSB system"]
3641 MAV_TYPE_ADSB = 27,
3642 #[doc = "Steerable, nonrigid airfoil"]
3643 MAV_TYPE_PARAFOIL = 28,
3644 #[doc = "Dodecarotor"]
3645 MAV_TYPE_DODECAROTOR = 29,
3646 #[doc = "Camera"]
3647 MAV_TYPE_CAMERA = 30,
3648 #[doc = "Charging station"]
3649 MAV_TYPE_CHARGING_STATION = 31,
3650 #[doc = "FLARM collision avoidance system"]
3651 MAV_TYPE_FLARM = 32,
3652 #[doc = "Servo"]
3653 MAV_TYPE_SERVO = 33,
3654 #[doc = "Open Drone ID. See <https://mavlink.io/en/services/opendroneid.html>."]
3655 MAV_TYPE_ODID = 34,
3656 #[doc = "Decarotor"]
3657 MAV_TYPE_DECAROTOR = 35,
3658 #[doc = "Battery"]
3659 MAV_TYPE_BATTERY = 36,
3660 #[doc = "Parachute"]
3661 MAV_TYPE_PARACHUTE = 37,
3662 #[doc = "Log"]
3663 MAV_TYPE_LOG = 38,
3664 #[doc = "OSD"]
3665 MAV_TYPE_OSD = 39,
3666 #[doc = "IMU"]
3667 MAV_TYPE_IMU = 40,
3668 #[doc = "GPS"]
3669 MAV_TYPE_GPS = 41,
3670 #[doc = "Winch"]
3671 MAV_TYPE_WINCH = 42,
3672 #[doc = "Generic multirotor that does not fit into a specific type or whose type is unknown"]
3673 MAV_TYPE_GENERIC_MULTIROTOR = 43,
3674 #[doc = "Illuminator. An illuminator is a light source that is used for lighting up dark areas external to the sytstem: e.g. a torch or searchlight (as opposed to a light source for illuminating the system itself, e.g. an indicator light)."]
3675 MAV_TYPE_ILLUMINATOR = 44,
3676 #[doc = "Orbiter spacecraft. Includes satellites orbiting terrestrial and extra-terrestrial bodies. Follows NASA Spacecraft Classification."]
3677 MAV_TYPE_SPACECRAFT_ORBITER = 45,
3678}
3679impl MavType {
3680 pub const DEFAULT: Self = Self::MAV_TYPE_GENERIC;
3681}
3682impl Default for MavType {
3683 fn default() -> Self {
3684 Self::DEFAULT
3685 }
3686}
3687#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3688#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3689#[cfg_attr(feature = "serde", serde(tag = "type"))]
3690#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3691#[repr(u32)]
3692#[doc = "Enumeration of VTOL states"]
3693pub enum MavVtolState {
3694 #[doc = "MAV is not configured as VTOL"]
3695 MAV_VTOL_STATE_UNDEFINED = 0,
3696 #[doc = "VTOL is in transition from multicopter to fixed-wing"]
3697 MAV_VTOL_STATE_TRANSITION_TO_FW = 1,
3698 #[doc = "VTOL is in transition from fixed-wing to multicopter"]
3699 MAV_VTOL_STATE_TRANSITION_TO_MC = 2,
3700 #[doc = "VTOL is in multicopter state"]
3701 MAV_VTOL_STATE_MC = 3,
3702 #[doc = "VTOL is in fixed-wing state"]
3703 MAV_VTOL_STATE_FW = 4,
3704}
3705impl MavVtolState {
3706 pub const DEFAULT: Self = Self::MAV_VTOL_STATE_UNDEFINED;
3707}
3708impl Default for MavVtolState {
3709 fn default() -> Self {
3710 Self::DEFAULT
3711 }
3712}
3713bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Winch status flags used in WINCH_STATUS"] pub struct MavWinchStatusFlag : u32 { # [doc = "Winch is healthy"] const MAV_WINCH_STATUS_HEALTHY = 1 ; # [doc = "Winch line is fully retracted"] const MAV_WINCH_STATUS_FULLY_RETRACTED = 2 ; # [doc = "Winch motor is moving"] const MAV_WINCH_STATUS_MOVING = 4 ; # [doc = "Winch clutch is engaged allowing motor to move freely."] const MAV_WINCH_STATUS_CLUTCH_ENGAGED = 8 ; # [doc = "Winch is locked by locking mechanism."] const MAV_WINCH_STATUS_LOCKED = 16 ; # [doc = "Winch is gravity dropping payload."] const MAV_WINCH_STATUS_DROPPING = 32 ; # [doc = "Winch is arresting payload descent."] const MAV_WINCH_STATUS_ARRESTING = 64 ; # [doc = "Winch is using torque measurements to sense the ground."] const MAV_WINCH_STATUS_GROUND_SENSE = 128 ; # [doc = "Winch is returning to the fully retracted position."] const MAV_WINCH_STATUS_RETRACTING = 256 ; # [doc = "Winch is redelivering the payload. This is a failover state if the line tension goes above a threshold during RETRACTING."] const MAV_WINCH_STATUS_REDELIVER = 512 ; # [doc = "Winch is abandoning the line and possibly payload. Winch unspools the entire calculated line length. This is a failover state from REDELIVER if the number of attempts exceeds a threshold."] const MAV_WINCH_STATUS_ABANDON_LINE = 1024 ; # [doc = "Winch is engaging the locking mechanism."] const MAV_WINCH_STATUS_LOCKING = 2048 ; # [doc = "Winch is spooling on line."] const MAV_WINCH_STATUS_LOAD_LINE = 4096 ; # [doc = "Winch is loading a payload."] const MAV_WINCH_STATUS_LOAD_PAYLOAD = 8192 ; } }
3714impl MavWinchStatusFlag {
3715 pub const DEFAULT: Self = Self::MAV_WINCH_STATUS_HEALTHY;
3716}
3717impl Default for MavWinchStatusFlag {
3718 fn default() -> Self {
3719 Self::DEFAULT
3720 }
3721}
3722#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3723#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3724#[cfg_attr(feature = "serde", serde(tag = "type"))]
3725#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3726#[repr(u32)]
3727pub enum MavlinkDataStreamType {
3728 MAVLINK_DATA_STREAM_IMG_JPEG = 0,
3729 MAVLINK_DATA_STREAM_IMG_BMP = 1,
3730 MAVLINK_DATA_STREAM_IMG_RAW8U = 2,
3731 MAVLINK_DATA_STREAM_IMG_RAW32U = 3,
3732 MAVLINK_DATA_STREAM_IMG_PGM = 4,
3733 MAVLINK_DATA_STREAM_IMG_PNG = 5,
3734}
3735impl MavlinkDataStreamType {
3736 pub const DEFAULT: Self = Self::MAVLINK_DATA_STREAM_IMG_JPEG;
3737}
3738impl Default for MavlinkDataStreamType {
3739 fn default() -> Self {
3740 Self::DEFAULT
3741 }
3742}
3743#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3744#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3745#[cfg_attr(feature = "serde", serde(tag = "type"))]
3746#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3747#[repr(u32)]
3748#[doc = "States of the mission state machine. Note that these states are independent of whether the mission is in a mode that can execute mission items or not (is suspended). They may not all be relevant on all vehicles."]
3749pub enum MissionState {
3750 #[doc = "The mission status reporting is not supported."]
3751 MISSION_STATE_UNKNOWN = 0,
3752 #[doc = "No mission on the vehicle."]
3753 MISSION_STATE_NO_MISSION = 1,
3754 #[doc = "Mission has not started. This is the case after a mission has uploaded but not yet started executing."]
3755 MISSION_STATE_NOT_STARTED = 2,
3756 #[doc = "Mission is active, and will execute mission items when in auto mode."]
3757 MISSION_STATE_ACTIVE = 3,
3758 #[doc = "Mission is paused when in auto mode."]
3759 MISSION_STATE_PAUSED = 4,
3760 #[doc = "Mission has executed all mission items."]
3761 MISSION_STATE_COMPLETE = 5,
3762}
3763impl MissionState {
3764 pub const DEFAULT: Self = Self::MISSION_STATE_UNKNOWN;
3765}
3766impl Default for MissionState {
3767 fn default() -> Self {
3768 Self::DEFAULT
3769 }
3770}
3771#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3772#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3773#[cfg_attr(feature = "serde", serde(tag = "type"))]
3774#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3775#[repr(u32)]
3776#[doc = "Sequence that motors are tested when using MAV_CMD_DO_MOTOR_TEST."]
3777pub enum MotorTestOrder {
3778 #[doc = "Default autopilot motor test method."]
3779 MOTOR_TEST_ORDER_DEFAULT = 0,
3780 #[doc = "Motor numbers are specified as their index in a predefined vehicle-specific sequence."]
3781 MOTOR_TEST_ORDER_SEQUENCE = 1,
3782 #[doc = "Motor numbers are specified as the output as labeled on the board."]
3783 MOTOR_TEST_ORDER_BOARD = 2,
3784}
3785impl MotorTestOrder {
3786 pub const DEFAULT: Self = Self::MOTOR_TEST_ORDER_DEFAULT;
3787}
3788impl Default for MotorTestOrder {
3789 fn default() -> Self {
3790 Self::DEFAULT
3791 }
3792}
3793#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3794#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3795#[cfg_attr(feature = "serde", serde(tag = "type"))]
3796#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3797#[repr(u32)]
3798#[doc = "Defines how throttle value is represented in MAV_CMD_DO_MOTOR_TEST."]
3799pub enum MotorTestThrottleType {
3800 #[doc = "Throttle as a percentage (0 ~ 100)"]
3801 MOTOR_TEST_THROTTLE_PERCENT = 0,
3802 #[doc = "Throttle as an absolute PWM value (normally in range of 1000~2000)."]
3803 MOTOR_TEST_THROTTLE_PWM = 1,
3804 #[doc = "Throttle pass-through from pilot's transmitter."]
3805 MOTOR_TEST_THROTTLE_PILOT = 2,
3806 #[doc = "Per-motor compass calibration test."]
3807 MOTOR_TEST_COMPASS_CAL = 3,
3808}
3809impl MotorTestThrottleType {
3810 pub const DEFAULT: Self = Self::MOTOR_TEST_THROTTLE_PERCENT;
3811}
3812impl Default for MotorTestThrottleType {
3813 fn default() -> Self {
3814 Self::DEFAULT
3815 }
3816}
3817#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3818#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3819#[cfg_attr(feature = "serde", serde(tag = "type"))]
3820#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3821#[repr(u32)]
3822pub enum NavVtolLandOptions {
3823 #[doc = "Default autopilot landing behaviour."]
3824 NAV_VTOL_LAND_OPTIONS_DEFAULT = 0,
3825 #[doc = "Descend in fixed wing mode, transitioning to multicopter mode for vertical landing when close to the ground. The fixed wing descent pattern is at the discretion of the vehicle (e.g. transition altitude, loiter direction, radius, and speed, etc.)."]
3826 NAV_VTOL_LAND_OPTIONS_FW_DESCENT = 1,
3827 #[doc = "Land in multicopter mode on reaching the landing coordinates (the whole landing is by \"hover descent\")."]
3828 NAV_VTOL_LAND_OPTIONS_HOVER_DESCENT = 2,
3829}
3830impl NavVtolLandOptions {
3831 pub const DEFAULT: Self = Self::NAV_VTOL_LAND_OPTIONS_DEFAULT;
3832}
3833impl Default for NavVtolLandOptions {
3834 fn default() -> Self {
3835 Self::DEFAULT
3836 }
3837}
3838#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3839#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3840#[cfg_attr(feature = "serde", serde(tag = "type"))]
3841#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3842#[repr(u32)]
3843#[doc = "Yaw behaviour during orbit flight."]
3844pub enum OrbitYawBehaviour {
3845 #[doc = "Vehicle front points to the center (default)."]
3846 ORBIT_YAW_BEHAVIOUR_HOLD_FRONT_TO_CIRCLE_CENTER = 0,
3847 #[doc = "Vehicle front holds heading when message received."]
3848 ORBIT_YAW_BEHAVIOUR_HOLD_INITIAL_HEADING = 1,
3849 #[doc = "Yaw uncontrolled."]
3850 ORBIT_YAW_BEHAVIOUR_UNCONTROLLED = 2,
3851 #[doc = "Vehicle front follows flight path (tangential to circle)."]
3852 ORBIT_YAW_BEHAVIOUR_HOLD_FRONT_TANGENT_TO_CIRCLE = 3,
3853 #[doc = "Yaw controlled by RC input."]
3854 ORBIT_YAW_BEHAVIOUR_RC_CONTROLLED = 4,
3855 #[doc = "Vehicle uses current yaw behaviour (unchanged). The vehicle-default yaw behaviour is used if this value is specified when orbit is first commanded."]
3856 ORBIT_YAW_BEHAVIOUR_UNCHANGED = 5,
3857}
3858impl OrbitYawBehaviour {
3859 pub const DEFAULT: Self = Self::ORBIT_YAW_BEHAVIOUR_HOLD_FRONT_TO_CIRCLE_CENTER;
3860}
3861impl Default for OrbitYawBehaviour {
3862 fn default() -> Self {
3863 Self::DEFAULT
3864 }
3865}
3866#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3867#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3868#[cfg_attr(feature = "serde", serde(tag = "type"))]
3869#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3870#[repr(u32)]
3871#[doc = "Parachute actions. Trigger release and enable/disable auto-release."]
3872pub enum ParachuteAction {
3873 #[doc = "Disable auto-release of parachute (i.e. release triggered by crash detectors)."]
3874 PARACHUTE_DISABLE = 0,
3875 #[doc = "Enable auto-release of parachute."]
3876 PARACHUTE_ENABLE = 1,
3877 #[doc = "Release parachute and kill motors."]
3878 PARACHUTE_RELEASE = 2,
3879}
3880impl ParachuteAction {
3881 pub const DEFAULT: Self = Self::PARACHUTE_DISABLE;
3882}
3883impl Default for ParachuteAction {
3884 fn default() -> Self {
3885 Self::DEFAULT
3886 }
3887}
3888#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3889#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3890#[cfg_attr(feature = "serde", serde(tag = "type"))]
3891#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3892#[repr(u32)]
3893#[doc = "Result from PARAM_EXT_SET message."]
3894pub enum ParamAck {
3895 #[doc = "Parameter value ACCEPTED and SET"]
3896 PARAM_ACK_ACCEPTED = 0,
3897 #[doc = "Parameter value UNKNOWN/UNSUPPORTED"]
3898 PARAM_ACK_VALUE_UNSUPPORTED = 1,
3899 #[doc = "Parameter failed to set"]
3900 PARAM_ACK_FAILED = 2,
3901 #[doc = "Parameter value received but not yet set/accepted. A subsequent PARAM_EXT_ACK with the final result will follow once operation is completed. This is returned immediately for parameters that take longer to set, indicating that the the parameter was received and does not need to be resent."]
3902 PARAM_ACK_IN_PROGRESS = 3,
3903}
3904impl ParamAck {
3905 pub const DEFAULT: Self = Self::PARAM_ACK_ACCEPTED;
3906}
3907impl Default for ParamAck {
3908 fn default() -> Self {
3909 Self::DEFAULT
3910 }
3911}
3912bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Bitmap to indicate which dimensions should be ignored by the vehicle: a value of 0b0000000000000000 or 0b0000001000000000 indicates that none of the setpoint dimensions should be ignored. If bit 9 is set the floats afx afy afz should be interpreted as force instead of acceleration."] pub struct PositionTargetTypemask : u16 { # [doc = "Ignore position x"] const POSITION_TARGET_TYPEMASK_X_IGNORE = 1 ; # [doc = "Ignore position y"] const POSITION_TARGET_TYPEMASK_Y_IGNORE = 2 ; # [doc = "Ignore position z"] const POSITION_TARGET_TYPEMASK_Z_IGNORE = 4 ; # [doc = "Ignore velocity x"] const POSITION_TARGET_TYPEMASK_VX_IGNORE = 8 ; # [doc = "Ignore velocity y"] const POSITION_TARGET_TYPEMASK_VY_IGNORE = 16 ; # [doc = "Ignore velocity z"] const POSITION_TARGET_TYPEMASK_VZ_IGNORE = 32 ; # [doc = "Ignore acceleration x"] const POSITION_TARGET_TYPEMASK_AX_IGNORE = 64 ; # [doc = "Ignore acceleration y"] const POSITION_TARGET_TYPEMASK_AY_IGNORE = 128 ; # [doc = "Ignore acceleration z"] const POSITION_TARGET_TYPEMASK_AZ_IGNORE = 256 ; # [doc = "Use force instead of acceleration"] const POSITION_TARGET_TYPEMASK_FORCE_SET = 512 ; # [doc = "Ignore yaw"] const POSITION_TARGET_TYPEMASK_YAW_IGNORE = 1024 ; # [doc = "Ignore yaw rate"] const POSITION_TARGET_TYPEMASK_YAW_RATE_IGNORE = 2048 ; } }
3913impl PositionTargetTypemask {
3914 pub const DEFAULT: Self = Self::POSITION_TARGET_TYPEMASK_X_IGNORE;
3915}
3916impl Default for PositionTargetTypemask {
3917 fn default() -> Self {
3918 Self::DEFAULT
3919 }
3920}
3921#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3922#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3923#[cfg_attr(feature = "serde", serde(tag = "type"))]
3924#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3925#[repr(u32)]
3926#[doc = "Precision land modes (used in MAV_CMD_NAV_LAND)."]
3927pub enum PrecisionLandMode {
3928 #[doc = "Normal (non-precision) landing."]
3929 PRECISION_LAND_MODE_DISABLED = 0,
3930 #[doc = "Use precision landing if beacon detected when land command accepted, otherwise land normally."]
3931 PRECISION_LAND_MODE_OPPORTUNISTIC = 1,
3932 #[doc = "Use precision landing, searching for beacon if not found when land command accepted (land normally if beacon cannot be found)."]
3933 PRECISION_LAND_MODE_REQUIRED = 2,
3934}
3935impl PrecisionLandMode {
3936 pub const DEFAULT: Self = Self::PRECISION_LAND_MODE_DISABLED;
3937}
3938impl Default for PrecisionLandMode {
3939 fn default() -> Self {
3940 Self::DEFAULT
3941 }
3942}
3943#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3944#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3945#[cfg_attr(feature = "serde", serde(tag = "type"))]
3946#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3947#[repr(u32)]
3948#[doc = "Actions for reading and writing plan information (mission, rally points, geofence) between persistent and volatile storage when using MAV_CMD_PREFLIGHT_STORAGE. (Commonly missions are loaded from persistent storage (flash/EEPROM) into volatile storage (RAM) on startup and written back when they are changed.)"]
3949pub enum PreflightStorageMissionAction {
3950 #[doc = "Read current mission data from persistent storage"]
3951 MISSION_READ_PERSISTENT = 0,
3952 #[doc = "Write current mission data to persistent storage"]
3953 MISSION_WRITE_PERSISTENT = 1,
3954 #[doc = "Erase all mission data stored on the vehicle (both persistent and volatile storage)"]
3955 MISSION_RESET_DEFAULT = 2,
3956}
3957impl PreflightStorageMissionAction {
3958 pub const DEFAULT: Self = Self::MISSION_READ_PERSISTENT;
3959}
3960impl Default for PreflightStorageMissionAction {
3961 fn default() -> Self {
3962 Self::DEFAULT
3963 }
3964}
3965#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3966#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3967#[cfg_attr(feature = "serde", serde(tag = "type"))]
3968#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3969#[repr(u32)]
3970#[doc = "Actions for reading/writing parameters between persistent and volatile storage when using MAV_CMD_PREFLIGHT_STORAGE. (Commonly parameters are loaded from persistent storage (flash/EEPROM) into volatile storage (RAM) on startup and written back when they are changed.)"]
3971pub enum PreflightStorageParameterAction {
3972 #[doc = "Read all parameters from persistent storage. Replaces values in volatile storage."]
3973 PARAM_READ_PERSISTENT = 0,
3974 #[doc = "Write all parameter values to persistent storage (flash/EEPROM)"]
3975 PARAM_WRITE_PERSISTENT = 1,
3976 #[doc = "Reset all user configurable parameters to their default value (including airframe selection, sensor calibration data, safety settings, and so on). Does not reset values that contain operation counters and vehicle computed statistics."]
3977 PARAM_RESET_CONFIG_DEFAULT = 2,
3978 #[doc = "Reset only sensor calibration parameters to factory defaults (or firmware default if not available)"]
3979 PARAM_RESET_SENSOR_DEFAULT = 3,
3980 #[doc = "Reset all parameters, including operation counters, to default values"]
3981 PARAM_RESET_ALL_DEFAULT = 4,
3982}
3983impl PreflightStorageParameterAction {
3984 pub const DEFAULT: Self = Self::PARAM_READ_PERSISTENT;
3985}
3986impl Default for PreflightStorageParameterAction {
3987 fn default() -> Self {
3988 Self::DEFAULT
3989 }
3990}
3991#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
3992#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
3993#[cfg_attr(feature = "serde", serde(tag = "type"))]
3994#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
3995#[repr(u32)]
3996#[doc = "RC sub-type of types defined in RC_TYPE. Used in MAV_CMD_START_RX_PAIR. Ignored if value does not correspond to the set RC_TYPE."]
3997pub enum RcSubType {
3998 #[doc = "Spektrum DSM2"]
3999 RC_SUB_TYPE_SPEKTRUM_DSM2 = 0,
4000 #[doc = "Spektrum DSMX"]
4001 RC_SUB_TYPE_SPEKTRUM_DSMX = 1,
4002 #[doc = "Spektrum DSMX8"]
4003 RC_SUB_TYPE_SPEKTRUM_DSMX8 = 2,
4004}
4005impl RcSubType {
4006 pub const DEFAULT: Self = Self::RC_SUB_TYPE_SPEKTRUM_DSM2;
4007}
4008impl Default for RcSubType {
4009 fn default() -> Self {
4010 Self::DEFAULT
4011 }
4012}
4013#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4014#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4015#[cfg_attr(feature = "serde", serde(tag = "type"))]
4016#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4017#[repr(u32)]
4018#[doc = "RC type. Used in MAV_CMD_START_RX_PAIR."]
4019pub enum RcType {
4020 #[doc = "Spektrum"]
4021 RC_TYPE_SPEKTRUM = 0,
4022 #[doc = "CRSF"]
4023 RC_TYPE_CRSF = 1,
4024}
4025impl RcType {
4026 pub const DEFAULT: Self = Self::RC_TYPE_SPEKTRUM;
4027}
4028impl Default for RcType {
4029 fn default() -> Self {
4030 Self::DEFAULT
4031 }
4032}
4033#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4034#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4035#[cfg_attr(feature = "serde", serde(tag = "type"))]
4036#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4037#[repr(u32)]
4038#[doc = "Specifies the conditions under which the MAV_CMD_PREFLIGHT_REBOOT_SHUTDOWN command should be accepted."]
4039pub enum RebootShutdownConditions {
4040 #[doc = "Reboot/Shutdown only if allowed by safety checks, such as being landed."]
4041 REBOOT_SHUTDOWN_CONDITIONS_SAFETY_INTERLOCKED = 0,
4042 #[doc = "Force reboot/shutdown of the autopilot/component regardless of system state."]
4043 REBOOT_SHUTDOWN_CONDITIONS_FORCE = 20190226,
4044}
4045impl RebootShutdownConditions {
4046 pub const DEFAULT: Self = Self::REBOOT_SHUTDOWN_CONDITIONS_SAFETY_INTERLOCKED;
4047}
4048impl Default for RebootShutdownConditions {
4049 fn default() -> Self {
4050 Self::DEFAULT
4051 }
4052}
4053#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4054#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4055#[cfg_attr(feature = "serde", serde(tag = "type"))]
4056#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4057#[repr(u32)]
4058#[doc = "RTK GPS baseline coordinate system, used for RTK corrections"]
4059pub enum RtkBaselineCoordinateSystem {
4060 #[doc = "Earth-centered, Earth-fixed"]
4061 RTK_BASELINE_COORDINATE_SYSTEM_ECEF = 0,
4062 #[doc = "RTK basestation centered, north, east, down"]
4063 RTK_BASELINE_COORDINATE_SYSTEM_NED = 1,
4064}
4065impl RtkBaselineCoordinateSystem {
4066 pub const DEFAULT: Self = Self::RTK_BASELINE_COORDINATE_SYSTEM_ECEF;
4067}
4068impl Default for RtkBaselineCoordinateSystem {
4069 fn default() -> Self {
4070 Self::DEFAULT
4071 }
4072}
4073#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4074#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4075#[cfg_attr(feature = "serde", serde(tag = "type"))]
4076#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4077#[repr(u32)]
4078#[doc = "Possible safety switch states."]
4079pub enum SafetySwitchState {
4080 #[doc = "Safety switch is engaged and vehicle should be safe to approach."]
4081 SAFETY_SWITCH_STATE_SAFE = 0,
4082 #[doc = "Safety switch is NOT engaged and motors, propellers and other actuators should be considered active."]
4083 SAFETY_SWITCH_STATE_DANGEROUS = 1,
4084}
4085impl SafetySwitchState {
4086 pub const DEFAULT: Self = Self::SAFETY_SWITCH_STATE_SAFE;
4087}
4088impl Default for SafetySwitchState {
4089 fn default() -> Self {
4090 Self::DEFAULT
4091 }
4092}
4093#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4094#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4095#[cfg_attr(feature = "serde", serde(tag = "type"))]
4096#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4097#[repr(u32)]
4098#[doc = "SERIAL_CONTROL device types"]
4099pub enum SerialControlDev {
4100 #[doc = "First telemetry port"]
4101 SERIAL_CONTROL_DEV_TELEM1 = 0,
4102 #[doc = "Second telemetry port"]
4103 SERIAL_CONTROL_DEV_TELEM2 = 1,
4104 #[doc = "First GPS port"]
4105 SERIAL_CONTROL_DEV_GPS1 = 2,
4106 #[doc = "Second GPS port"]
4107 SERIAL_CONTROL_DEV_GPS2 = 3,
4108 #[doc = "system shell"]
4109 SERIAL_CONTROL_DEV_SHELL = 10,
4110 #[doc = "SERIAL0"]
4111 SERIAL_CONTROL_SERIAL0 = 100,
4112 #[doc = "SERIAL1"]
4113 SERIAL_CONTROL_SERIAL1 = 101,
4114 #[doc = "SERIAL2"]
4115 SERIAL_CONTROL_SERIAL2 = 102,
4116 #[doc = "SERIAL3"]
4117 SERIAL_CONTROL_SERIAL3 = 103,
4118 #[doc = "SERIAL4"]
4119 SERIAL_CONTROL_SERIAL4 = 104,
4120 #[doc = "SERIAL5"]
4121 SERIAL_CONTROL_SERIAL5 = 105,
4122 #[doc = "SERIAL6"]
4123 SERIAL_CONTROL_SERIAL6 = 106,
4124 #[doc = "SERIAL7"]
4125 SERIAL_CONTROL_SERIAL7 = 107,
4126 #[doc = "SERIAL8"]
4127 SERIAL_CONTROL_SERIAL8 = 108,
4128 #[doc = "SERIAL9"]
4129 SERIAL_CONTROL_SERIAL9 = 109,
4130}
4131impl SerialControlDev {
4132 pub const DEFAULT: Self = Self::SERIAL_CONTROL_DEV_TELEM1;
4133}
4134impl Default for SerialControlDev {
4135 fn default() -> Self {
4136 Self::DEFAULT
4137 }
4138}
4139bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "SERIAL_CONTROL flags (bitmask)"] pub struct SerialControlFlag : u8 { # [doc = "Set if this is a reply"] const SERIAL_CONTROL_FLAG_REPLY = 1 ; # [doc = "Set if the sender wants the receiver to send a response as another SERIAL_CONTROL message"] const SERIAL_CONTROL_FLAG_RESPOND = 2 ; # [doc = "Set if access to the serial port should be removed from whatever driver is currently using it, giving exclusive access to the SERIAL_CONTROL protocol. The port can be handed back by sending a request without this flag set"] const SERIAL_CONTROL_FLAG_EXCLUSIVE = 4 ; # [doc = "Block on writes to the serial port"] const SERIAL_CONTROL_FLAG_BLOCKING = 8 ; # [doc = "Send multiple replies until port is drained"] const SERIAL_CONTROL_FLAG_MULTI = 16 ; } }
4140impl SerialControlFlag {
4141 pub const DEFAULT: Self = Self::SERIAL_CONTROL_FLAG_REPLY;
4142}
4143impl Default for SerialControlFlag {
4144 fn default() -> Self {
4145 Self::DEFAULT
4146 }
4147}
4148#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4149#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4150#[cfg_attr(feature = "serde", serde(tag = "type"))]
4151#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4152#[repr(u32)]
4153#[doc = "Focus types for MAV_CMD_SET_CAMERA_FOCUS"]
4154pub enum SetFocusType {
4155 #[doc = "Focus one step increment (-1 for focusing in, 1 for focusing out towards infinity)."]
4156 FOCUS_TYPE_STEP = 0,
4157 #[doc = "Continuous normalized focus in/out rate until stopped. Range -1..1, negative: in, positive: out towards infinity, 0 to stop focusing. Other values should be clipped to the range."]
4158 FOCUS_TYPE_CONTINUOUS = 1,
4159 #[doc = "Focus value as proportion of full camera focus range (a value between 0.0 and 100.0)"]
4160 FOCUS_TYPE_RANGE = 2,
4161 #[doc = "Focus value in metres. Note that there is no message to get the valid focus range of the camera, so this can type can only be used for cameras where the range is known (implying that this cannot reliably be used in a GCS for an arbitrary camera)."]
4162 FOCUS_TYPE_METERS = 3,
4163 #[doc = "Focus automatically."]
4164 FOCUS_TYPE_AUTO = 4,
4165 #[doc = "Single auto focus. Mainly used for still pictures. Usually abbreviated as AF-S."]
4166 FOCUS_TYPE_AUTO_SINGLE = 5,
4167 #[doc = "Continuous auto focus. Mainly used for dynamic scenes. Abbreviated as AF-C."]
4168 FOCUS_TYPE_AUTO_CONTINUOUS = 6,
4169}
4170impl SetFocusType {
4171 pub const DEFAULT: Self = Self::FOCUS_TYPE_STEP;
4172}
4173impl Default for SetFocusType {
4174 fn default() -> Self {
4175 Self::DEFAULT
4176 }
4177}
4178#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4179#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4180#[cfg_attr(feature = "serde", serde(tag = "type"))]
4181#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4182#[repr(u32)]
4183#[doc = "Speed setpoint types used in MAV_CMD_DO_CHANGE_SPEED"]
4184pub enum SpeedType {
4185 #[doc = "Airspeed"]
4186 SPEED_TYPE_AIRSPEED = 0,
4187 #[doc = "Groundspeed"]
4188 SPEED_TYPE_GROUNDSPEED = 1,
4189 #[doc = "Climb speed"]
4190 SPEED_TYPE_CLIMB_SPEED = 2,
4191 #[doc = "Descent speed"]
4192 SPEED_TYPE_DESCENT_SPEED = 3,
4193}
4194impl SpeedType {
4195 pub const DEFAULT: Self = Self::SPEED_TYPE_AIRSPEED;
4196}
4197impl Default for SpeedType {
4198 fn default() -> Self {
4199 Self::DEFAULT
4200 }
4201}
4202#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4203#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4204#[cfg_attr(feature = "serde", serde(tag = "type"))]
4205#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4206#[repr(u32)]
4207#[doc = "Flags to indicate the status of camera storage."]
4208pub enum StorageStatus {
4209 #[doc = "Storage is missing (no microSD card loaded for example.)"]
4210 STORAGE_STATUS_EMPTY = 0,
4211 #[doc = "Storage present but unformatted."]
4212 STORAGE_STATUS_UNFORMATTED = 1,
4213 #[doc = "Storage present and ready."]
4214 STORAGE_STATUS_READY = 2,
4215 #[doc = "Camera does not supply storage status information. Capacity information in STORAGE_INFORMATION fields will be ignored."]
4216 STORAGE_STATUS_NOT_SUPPORTED = 3,
4217}
4218impl StorageStatus {
4219 pub const DEFAULT: Self = Self::STORAGE_STATUS_EMPTY;
4220}
4221impl Default for StorageStatus {
4222 fn default() -> Self {
4223 Self::DEFAULT
4224 }
4225}
4226#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4227#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4228#[cfg_attr(feature = "serde", serde(tag = "type"))]
4229#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4230#[repr(u32)]
4231#[doc = "Flags to indicate the type of storage."]
4232pub enum StorageType {
4233 #[doc = "Storage type is not known."]
4234 STORAGE_TYPE_UNKNOWN = 0,
4235 #[doc = "Storage type is USB device."]
4236 STORAGE_TYPE_USB_STICK = 1,
4237 #[doc = "Storage type is SD card."]
4238 STORAGE_TYPE_SD = 2,
4239 #[doc = "Storage type is microSD card."]
4240 STORAGE_TYPE_MICROSD = 3,
4241 #[doc = "Storage type is CFast."]
4242 STORAGE_TYPE_CF = 4,
4243 #[doc = "Storage type is CFexpress."]
4244 STORAGE_TYPE_CFE = 5,
4245 #[doc = "Storage type is XQD."]
4246 STORAGE_TYPE_XQD = 6,
4247 #[doc = "Storage type is HD mass storage type."]
4248 STORAGE_TYPE_HD = 7,
4249 #[doc = "Storage type is other, not listed type."]
4250 STORAGE_TYPE_OTHER = 254,
4251}
4252impl StorageType {
4253 pub const DEFAULT: Self = Self::STORAGE_TYPE_UNKNOWN;
4254}
4255impl Default for StorageType {
4256 fn default() -> Self {
4257 Self::DEFAULT
4258 }
4259}
4260bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Flags to indicate usage for a particular storage (see STORAGE_INFORMATION.storage_usage and MAV_CMD_SET_STORAGE_USAGE)."] pub struct StorageUsageFlag : u8 { # [doc = "Always set to 1 (indicates STORAGE_INFORMATION.storage_usage is supported)."] const STORAGE_USAGE_FLAG_SET = 1 ; # [doc = "Storage for saving photos."] const STORAGE_USAGE_FLAG_PHOTO = 2 ; # [doc = "Storage for saving videos."] const STORAGE_USAGE_FLAG_VIDEO = 4 ; # [doc = "Storage for saving logs."] const STORAGE_USAGE_FLAG_LOGS = 8 ; } }
4261impl StorageUsageFlag {
4262 pub const DEFAULT: Self = Self::STORAGE_USAGE_FLAG_SET;
4263}
4264impl Default for StorageUsageFlag {
4265 fn default() -> Self {
4266 Self::DEFAULT
4267 }
4268}
4269#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4270#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4271#[cfg_attr(feature = "serde", serde(tag = "type"))]
4272#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4273#[repr(u32)]
4274#[doc = "Tune formats (used for vehicle buzzer/tone generation)."]
4275pub enum TuneFormat {
4276 #[doc = "Format is QBasic 1.1 Play: <https://www.qbasic.net/en/reference/qb11/Statement/PLAY-006.htm>."]
4277 TUNE_FORMAT_QBASIC1_1 = 1,
4278 #[doc = "Format is Modern Music Markup Language (MML): <https://en.wikipedia.org/wiki/Music_Macro_Language#Modern_MML>."]
4279 TUNE_FORMAT_MML_MODERN = 2,
4280}
4281impl TuneFormat {
4282 pub const DEFAULT: Self = Self::TUNE_FORMAT_QBASIC1_1;
4283}
4284impl Default for TuneFormat {
4285 fn default() -> Self {
4286 Self::DEFAULT
4287 }
4288}
4289#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4290#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4291#[cfg_attr(feature = "serde", serde(tag = "type"))]
4292#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4293#[repr(u32)]
4294#[doc = "Generalized UAVCAN node health"]
4295pub enum UavcanNodeHealth {
4296 #[doc = "The node is functioning properly."]
4297 UAVCAN_NODE_HEALTH_OK = 0,
4298 #[doc = "A critical parameter went out of range or the node has encountered a minor failure."]
4299 UAVCAN_NODE_HEALTH_WARNING = 1,
4300 #[doc = "The node has encountered a major failure."]
4301 UAVCAN_NODE_HEALTH_ERROR = 2,
4302 #[doc = "The node has suffered a fatal malfunction."]
4303 UAVCAN_NODE_HEALTH_CRITICAL = 3,
4304}
4305impl UavcanNodeHealth {
4306 pub const DEFAULT: Self = Self::UAVCAN_NODE_HEALTH_OK;
4307}
4308impl Default for UavcanNodeHealth {
4309 fn default() -> Self {
4310 Self::DEFAULT
4311 }
4312}
4313#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4314#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4315#[cfg_attr(feature = "serde", serde(tag = "type"))]
4316#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4317#[repr(u32)]
4318#[doc = "Generalized UAVCAN node mode"]
4319pub enum UavcanNodeMode {
4320 #[doc = "The node is performing its primary functions."]
4321 UAVCAN_NODE_MODE_OPERATIONAL = 0,
4322 #[doc = "The node is initializing; this mode is entered immediately after startup."]
4323 UAVCAN_NODE_MODE_INITIALIZATION = 1,
4324 #[doc = "The node is under maintenance."]
4325 UAVCAN_NODE_MODE_MAINTENANCE = 2,
4326 #[doc = "The node is in the process of updating its software."]
4327 UAVCAN_NODE_MODE_SOFTWARE_UPDATE = 3,
4328 #[doc = "The node is no longer available online."]
4329 UAVCAN_NODE_MODE_OFFLINE = 7,
4330}
4331impl UavcanNodeMode {
4332 pub const DEFAULT: Self = Self::UAVCAN_NODE_MODE_OPERATIONAL;
4333}
4334impl Default for UavcanNodeMode {
4335 fn default() -> Self {
4336 Self::DEFAULT
4337 }
4338}
4339bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Flags for the global position report."] pub struct UtmDataAvailFlags : u8 { # [doc = "The field time contains valid data."] const UTM_DATA_AVAIL_FLAGS_TIME_VALID = 1 ; # [doc = "The field uas_id contains valid data."] const UTM_DATA_AVAIL_FLAGS_UAS_ID_AVAILABLE = 2 ; # [doc = "The fields lat, lon and h_acc contain valid data."] const UTM_DATA_AVAIL_FLAGS_POSITION_AVAILABLE = 4 ; # [doc = "The fields alt and v_acc contain valid data."] const UTM_DATA_AVAIL_FLAGS_ALTITUDE_AVAILABLE = 8 ; # [doc = "The field relative_alt contains valid data."] const UTM_DATA_AVAIL_FLAGS_RELATIVE_ALTITUDE_AVAILABLE = 16 ; # [doc = "The fields vx and vy contain valid data."] const UTM_DATA_AVAIL_FLAGS_HORIZONTAL_VELO_AVAILABLE = 32 ; # [doc = "The field vz contains valid data."] const UTM_DATA_AVAIL_FLAGS_VERTICAL_VELO_AVAILABLE = 64 ; # [doc = "The fields next_lat, next_lon and next_alt contain valid data."] const UTM_DATA_AVAIL_FLAGS_NEXT_WAYPOINT_AVAILABLE = 128 ; } }
4340impl UtmDataAvailFlags {
4341 pub const DEFAULT: Self = Self::UTM_DATA_AVAIL_FLAGS_TIME_VALID;
4342}
4343impl Default for UtmDataAvailFlags {
4344 fn default() -> Self {
4345 Self::DEFAULT
4346 }
4347}
4348#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4349#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4350#[cfg_attr(feature = "serde", serde(tag = "type"))]
4351#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4352#[repr(u32)]
4353#[doc = "Airborne status of UAS."]
4354pub enum UtmFlightState {
4355 #[doc = "The flight state can't be determined."]
4356 UTM_FLIGHT_STATE_UNKNOWN = 1,
4357 #[doc = "UAS on ground."]
4358 UTM_FLIGHT_STATE_GROUND = 2,
4359 #[doc = "UAS airborne."]
4360 UTM_FLIGHT_STATE_AIRBORNE = 3,
4361 #[doc = "UAS is in an emergency flight state."]
4362 UTM_FLIGHT_STATE_EMERGENCY = 16,
4363 #[doc = "UAS has no active controls."]
4364 UTM_FLIGHT_STATE_NOCTRL = 32,
4365}
4366impl UtmFlightState {
4367 pub const DEFAULT: Self = Self::UTM_FLIGHT_STATE_UNKNOWN;
4368}
4369impl Default for UtmFlightState {
4370 fn default() -> Self {
4371 Self::DEFAULT
4372 }
4373}
4374#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4375#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4376#[cfg_attr(feature = "serde", serde(tag = "type"))]
4377#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4378#[repr(u32)]
4379#[doc = "Video stream encodings"]
4380pub enum VideoStreamEncoding {
4381 #[doc = "Stream encoding is unknown"]
4382 VIDEO_STREAM_ENCODING_UNKNOWN = 0,
4383 #[doc = "Stream encoding is H.264"]
4384 VIDEO_STREAM_ENCODING_H264 = 1,
4385 #[doc = "Stream encoding is H.265"]
4386 VIDEO_STREAM_ENCODING_H265 = 2,
4387}
4388impl VideoStreamEncoding {
4389 pub const DEFAULT: Self = Self::VIDEO_STREAM_ENCODING_UNKNOWN;
4390}
4391impl Default for VideoStreamEncoding {
4392 fn default() -> Self {
4393 Self::DEFAULT
4394 }
4395}
4396bitflags! { # [cfg_attr (feature = "serde" , derive (Serialize , Deserialize))] # [cfg_attr (feature = "arbitrary" , derive (Arbitrary))] # [derive (Debug , Copy , Clone , PartialEq)] # [doc = "Stream status flags (Bitmap)"] pub struct VideoStreamStatusFlags : u16 { # [doc = "Stream is active (running)"] const VIDEO_STREAM_STATUS_FLAGS_RUNNING = 1 ; # [doc = "Stream is thermal imaging"] const VIDEO_STREAM_STATUS_FLAGS_THERMAL = 2 ; # [doc = "Stream can report absolute thermal range (see CAMERA_THERMAL_RANGE)."] const VIDEO_STREAM_STATUS_FLAGS_THERMAL_RANGE_ENABLED = 4 ; } }
4397impl VideoStreamStatusFlags {
4398 pub const DEFAULT: Self = Self::VIDEO_STREAM_STATUS_FLAGS_RUNNING;
4399}
4400impl Default for VideoStreamStatusFlags {
4401 fn default() -> Self {
4402 Self::DEFAULT
4403 }
4404}
4405#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4406#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4407#[cfg_attr(feature = "serde", serde(tag = "type"))]
4408#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4409#[repr(u32)]
4410#[doc = "Video stream types"]
4411pub enum VideoStreamType {
4412 #[doc = "Stream is RTSP"]
4413 VIDEO_STREAM_TYPE_RTSP = 0,
4414 #[doc = "Stream is RTP UDP (URI gives the port number)"]
4415 VIDEO_STREAM_TYPE_RTPUDP = 1,
4416 #[doc = "Stream is MPEG on TCP"]
4417 VIDEO_STREAM_TYPE_TCP_MPEG = 2,
4418 #[doc = "Stream is MPEG TS (URI gives the port number)"]
4419 VIDEO_STREAM_TYPE_MPEG_TS = 3,
4420}
4421impl VideoStreamType {
4422 pub const DEFAULT: Self = Self::VIDEO_STREAM_TYPE_RTSP;
4423}
4424impl Default for VideoStreamType {
4425 fn default() -> Self {
4426 Self::DEFAULT
4427 }
4428}
4429#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4430#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4431#[cfg_attr(feature = "serde", serde(tag = "type"))]
4432#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4433#[repr(u32)]
4434#[doc = "Direction of VTOL transition"]
4435pub enum VtolTransitionHeading {
4436 #[doc = "Respect the heading configuration of the vehicle."]
4437 VTOL_TRANSITION_HEADING_VEHICLE_DEFAULT = 0,
4438 #[doc = "Use the heading pointing towards the next waypoint."]
4439 VTOL_TRANSITION_HEADING_NEXT_WAYPOINT = 1,
4440 #[doc = "Use the heading on takeoff (while sitting on the ground)."]
4441 VTOL_TRANSITION_HEADING_TAKEOFF = 2,
4442 #[doc = "Use the specified heading in parameter 4."]
4443 VTOL_TRANSITION_HEADING_SPECIFIED = 3,
4444 #[doc = "Use the current heading when reaching takeoff altitude (potentially facing the wind when weather-vaning is active)."]
4445 VTOL_TRANSITION_HEADING_ANY = 4,
4446}
4447impl VtolTransitionHeading {
4448 pub const DEFAULT: Self = Self::VTOL_TRANSITION_HEADING_VEHICLE_DEFAULT;
4449}
4450impl Default for VtolTransitionHeading {
4451 fn default() -> Self {
4452 Self::DEFAULT
4453 }
4454}
4455#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4456#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4457#[cfg_attr(feature = "serde", serde(tag = "type"))]
4458#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4459#[repr(u32)]
4460#[doc = "WiFi Mode."]
4461pub enum WifiConfigApMode {
4462 #[doc = "WiFi mode is undefined."]
4463 WIFI_CONFIG_AP_MODE_UNDEFINED = 0,
4464 #[doc = "WiFi configured as an access point."]
4465 WIFI_CONFIG_AP_MODE_AP = 1,
4466 #[doc = "WiFi configured as a station connected to an existing local WiFi network."]
4467 WIFI_CONFIG_AP_MODE_STATION = 2,
4468 #[doc = "WiFi disabled."]
4469 WIFI_CONFIG_AP_MODE_DISABLED = 3,
4470}
4471impl WifiConfigApMode {
4472 pub const DEFAULT: Self = Self::WIFI_CONFIG_AP_MODE_UNDEFINED;
4473}
4474impl Default for WifiConfigApMode {
4475 fn default() -> Self {
4476 Self::DEFAULT
4477 }
4478}
4479#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4480#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4481#[cfg_attr(feature = "serde", serde(tag = "type"))]
4482#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4483#[repr(u32)]
4484#[doc = "Possible responses from a WIFI_CONFIG_AP message."]
4485pub enum WifiConfigApResponse {
4486 #[doc = "Undefined response. Likely an indicative of a system that doesn't support this request."]
4487 WIFI_CONFIG_AP_RESPONSE_UNDEFINED = 0,
4488 #[doc = "Changes accepted."]
4489 WIFI_CONFIG_AP_RESPONSE_ACCEPTED = 1,
4490 #[doc = "Changes rejected."]
4491 WIFI_CONFIG_AP_RESPONSE_REJECTED = 2,
4492 #[doc = "Invalid Mode."]
4493 WIFI_CONFIG_AP_RESPONSE_MODE_ERROR = 3,
4494 #[doc = "Invalid SSID."]
4495 WIFI_CONFIG_AP_RESPONSE_SSID_ERROR = 4,
4496 #[doc = "Invalid Password."]
4497 WIFI_CONFIG_AP_RESPONSE_PASSWORD_ERROR = 5,
4498}
4499impl WifiConfigApResponse {
4500 pub const DEFAULT: Self = Self::WIFI_CONFIG_AP_RESPONSE_UNDEFINED;
4501}
4502impl Default for WifiConfigApResponse {
4503 fn default() -> Self {
4504 Self::DEFAULT
4505 }
4506}
4507#[derive(Debug, Copy, Clone, PartialEq, FromPrimitive, ToPrimitive)]
4508#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4509#[cfg_attr(feature = "serde", serde(tag = "type"))]
4510#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4511#[repr(u32)]
4512#[doc = "Winch actions."]
4513pub enum WinchActions {
4514 #[doc = "Allow motor to freewheel."]
4515 WINCH_RELAXED = 0,
4516 #[doc = "Wind or unwind specified length of line, optionally using specified rate."]
4517 WINCH_RELATIVE_LENGTH_CONTROL = 1,
4518 #[doc = "Wind or unwind line at specified rate."]
4519 WINCH_RATE_CONTROL = 2,
4520 #[doc = "Perform the locking sequence to relieve motor while in the fully retracted position. Only action and instance command parameters are used, others are ignored."]
4521 WINCH_LOCK = 3,
4522 #[doc = "Sequence of drop, slow down, touch down, reel up, lock. Only action and instance command parameters are used, others are ignored."]
4523 WINCH_DELIVER = 4,
4524 #[doc = "Engage motor and hold current position. Only action and instance command parameters are used, others are ignored."]
4525 WINCH_HOLD = 5,
4526 #[doc = "Return the reel to the fully retracted position. Only action and instance command parameters are used, others are ignored."]
4527 WINCH_RETRACT = 6,
4528 #[doc = "Load the reel with line. The winch will calculate the total loaded length and stop when the tension exceeds a threshold. Only action and instance command parameters are used, others are ignored."]
4529 WINCH_LOAD_LINE = 7,
4530 #[doc = "Spool out the entire length of the line. Only action and instance command parameters are used, others are ignored."]
4531 WINCH_ABANDON_LINE = 8,
4532 #[doc = "Spools out just enough to present the hook to the user to load the payload. Only action and instance command parameters are used, others are ignored"]
4533 WINCH_LOAD_PAYLOAD = 9,
4534}
4535impl WinchActions {
4536 pub const DEFAULT: Self = Self::WINCH_RELAXED;
4537}
4538impl Default for WinchActions {
4539 fn default() -> Self {
4540 Self::DEFAULT
4541 }
4542}
4543#[doc = "Set the vehicle attitude and body angular rates."]
4544#[doc = ""]
4545#[doc = "ID: 140"]
4546#[derive(Debug, Clone, PartialEq)]
4547#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4548#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4549pub struct ACTUATOR_CONTROL_TARGET_DATA {
4550 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
4551 pub time_usec: u64,
4552 #[doc = "Actuator controls. Normed to -1..+1 where 0 is neutral position. Throttle for single rotation direction motors is 0..1, negative range for reverse direction. Standard mapping for attitude controls (group 0): (index 0-7): roll, pitch, yaw, throttle, flaps, spoilers, airbrakes, landing gear. Load a pass-through mixer to repurpose them as generic outputs."]
4553 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
4554 pub controls: [f32; 8],
4555 #[doc = "Actuator group. The \"_mlx\" indicates this is a multi-instance message and a MAVLink parser should use this field to difference between instances."]
4556 pub group_mlx: u8,
4557}
4558impl ACTUATOR_CONTROL_TARGET_DATA {
4559 pub const ENCODED_LEN: usize = 41usize;
4560 pub const DEFAULT: Self = Self {
4561 time_usec: 0_u64,
4562 controls: [0.0_f32; 8usize],
4563 group_mlx: 0_u8,
4564 };
4565 #[cfg(feature = "arbitrary")]
4566 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
4567 use arbitrary::{Arbitrary, Unstructured};
4568 let mut buf = [0u8; 1024];
4569 rng.fill_bytes(&mut buf);
4570 let mut unstructured = Unstructured::new(&buf);
4571 Self::arbitrary(&mut unstructured).unwrap_or_default()
4572 }
4573}
4574impl Default for ACTUATOR_CONTROL_TARGET_DATA {
4575 fn default() -> Self {
4576 Self::DEFAULT.clone()
4577 }
4578}
4579impl MessageData for ACTUATOR_CONTROL_TARGET_DATA {
4580 type Message = MavMessage;
4581 const ID: u32 = 140u32;
4582 const NAME: &'static str = "ACTUATOR_CONTROL_TARGET";
4583 const EXTRA_CRC: u8 = 181u8;
4584 const ENCODED_LEN: usize = 41usize;
4585 fn deser(
4586 _version: MavlinkVersion,
4587 __input: &[u8],
4588 ) -> Result<Self, ::mavlink_core::error::ParserError> {
4589 let avail_len = __input.len();
4590 let mut payload_buf = [0; Self::ENCODED_LEN];
4591 let mut buf = if avail_len < Self::ENCODED_LEN {
4592 payload_buf[0..avail_len].copy_from_slice(__input);
4593 Bytes::new(&payload_buf)
4594 } else {
4595 Bytes::new(__input)
4596 };
4597 let mut __struct = Self::default();
4598 __struct.time_usec = buf.get_u64_le();
4599 for v in &mut __struct.controls {
4600 let val = buf.get_f32_le();
4601 *v = val;
4602 }
4603 __struct.group_mlx = buf.get_u8();
4604 Ok(__struct)
4605 }
4606 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
4607 let mut __tmp = BytesMut::new(bytes);
4608 #[allow(clippy::absurd_extreme_comparisons)]
4609 #[allow(unused_comparisons)]
4610 if __tmp.remaining() < Self::ENCODED_LEN {
4611 panic!(
4612 "buffer is too small (need {} bytes, but got {})",
4613 Self::ENCODED_LEN,
4614 __tmp.remaining(),
4615 )
4616 }
4617 __tmp.put_u64_le(self.time_usec);
4618 for val in &self.controls {
4619 __tmp.put_f32_le(*val);
4620 }
4621 __tmp.put_u8(self.group_mlx);
4622 if matches!(version, MavlinkVersion::V2) {
4623 let len = __tmp.len();
4624 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
4625 } else {
4626 __tmp.len()
4627 }
4628 }
4629}
4630#[doc = "The raw values of the actuator outputs (e.g. on Pixhawk, from MAIN, AUX ports). This message supersedes SERVO_OUTPUT_RAW."]
4631#[doc = ""]
4632#[doc = "ID: 375"]
4633#[derive(Debug, Clone, PartialEq)]
4634#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4635#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4636pub struct ACTUATOR_OUTPUT_STATUS_DATA {
4637 #[doc = "Timestamp (since system boot)."]
4638 pub time_usec: u64,
4639 #[doc = "Active outputs"]
4640 pub active: u32,
4641 #[doc = "Servo / motor output array values. Zero values indicate unused channels."]
4642 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
4643 pub actuator: [f32; 32],
4644}
4645impl ACTUATOR_OUTPUT_STATUS_DATA {
4646 pub const ENCODED_LEN: usize = 140usize;
4647 pub const DEFAULT: Self = Self {
4648 time_usec: 0_u64,
4649 active: 0_u32,
4650 actuator: [0.0_f32; 32usize],
4651 };
4652 #[cfg(feature = "arbitrary")]
4653 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
4654 use arbitrary::{Arbitrary, Unstructured};
4655 let mut buf = [0u8; 1024];
4656 rng.fill_bytes(&mut buf);
4657 let mut unstructured = Unstructured::new(&buf);
4658 Self::arbitrary(&mut unstructured).unwrap_or_default()
4659 }
4660}
4661impl Default for ACTUATOR_OUTPUT_STATUS_DATA {
4662 fn default() -> Self {
4663 Self::DEFAULT.clone()
4664 }
4665}
4666impl MessageData for ACTUATOR_OUTPUT_STATUS_DATA {
4667 type Message = MavMessage;
4668 const ID: u32 = 375u32;
4669 const NAME: &'static str = "ACTUATOR_OUTPUT_STATUS";
4670 const EXTRA_CRC: u8 = 251u8;
4671 const ENCODED_LEN: usize = 140usize;
4672 fn deser(
4673 _version: MavlinkVersion,
4674 __input: &[u8],
4675 ) -> Result<Self, ::mavlink_core::error::ParserError> {
4676 let avail_len = __input.len();
4677 let mut payload_buf = [0; Self::ENCODED_LEN];
4678 let mut buf = if avail_len < Self::ENCODED_LEN {
4679 payload_buf[0..avail_len].copy_from_slice(__input);
4680 Bytes::new(&payload_buf)
4681 } else {
4682 Bytes::new(__input)
4683 };
4684 let mut __struct = Self::default();
4685 __struct.time_usec = buf.get_u64_le();
4686 __struct.active = buf.get_u32_le();
4687 for v in &mut __struct.actuator {
4688 let val = buf.get_f32_le();
4689 *v = val;
4690 }
4691 Ok(__struct)
4692 }
4693 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
4694 let mut __tmp = BytesMut::new(bytes);
4695 #[allow(clippy::absurd_extreme_comparisons)]
4696 #[allow(unused_comparisons)]
4697 if __tmp.remaining() < Self::ENCODED_LEN {
4698 panic!(
4699 "buffer is too small (need {} bytes, but got {})",
4700 Self::ENCODED_LEN,
4701 __tmp.remaining(),
4702 )
4703 }
4704 __tmp.put_u64_le(self.time_usec);
4705 __tmp.put_u32_le(self.active);
4706 for val in &self.actuator {
4707 __tmp.put_f32_le(*val);
4708 }
4709 if matches!(version, MavlinkVersion::V2) {
4710 let len = __tmp.len();
4711 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
4712 } else {
4713 __tmp.len()
4714 }
4715 }
4716}
4717#[doc = "The location and information of an ADSB vehicle."]
4718#[doc = ""]
4719#[doc = "ID: 246"]
4720#[derive(Debug, Clone, PartialEq)]
4721#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4722#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4723pub struct ADSB_VEHICLE_DATA {
4724 #[doc = "ICAO address"]
4725 pub ICAO_address: u32,
4726 #[doc = "Latitude"]
4727 pub lat: i32,
4728 #[doc = "Longitude"]
4729 pub lon: i32,
4730 #[doc = "Altitude(ASL)"]
4731 pub altitude: i32,
4732 #[doc = "Course over ground"]
4733 pub heading: u16,
4734 #[doc = "The horizontal velocity"]
4735 pub hor_velocity: u16,
4736 #[doc = "The vertical velocity. Positive is up"]
4737 pub ver_velocity: i16,
4738 #[doc = "Bitmap to indicate various statuses including valid data fields"]
4739 pub flags: AdsbFlags,
4740 #[doc = "Squawk code. Note that the code is in decimal: e.g. 7700 (general emergency) is encoded as binary 0b0001_1110_0001_0100, not(!) as 0b0000_111_111_000_000"]
4741 pub squawk: u16,
4742 #[doc = "ADSB altitude type."]
4743 pub altitude_type: AdsbAltitudeType,
4744 #[doc = "The callsign, 8+null"]
4745 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
4746 pub callsign: [u8; 9],
4747 #[doc = "ADSB emitter type."]
4748 pub emitter_type: AdsbEmitterType,
4749 #[doc = "Time since last communication in seconds"]
4750 pub tslc: u8,
4751}
4752impl ADSB_VEHICLE_DATA {
4753 pub const ENCODED_LEN: usize = 38usize;
4754 pub const DEFAULT: Self = Self {
4755 ICAO_address: 0_u32,
4756 lat: 0_i32,
4757 lon: 0_i32,
4758 altitude: 0_i32,
4759 heading: 0_u16,
4760 hor_velocity: 0_u16,
4761 ver_velocity: 0_i16,
4762 flags: AdsbFlags::DEFAULT,
4763 squawk: 0_u16,
4764 altitude_type: AdsbAltitudeType::DEFAULT,
4765 callsign: [0_u8; 9usize],
4766 emitter_type: AdsbEmitterType::DEFAULT,
4767 tslc: 0_u8,
4768 };
4769 #[cfg(feature = "arbitrary")]
4770 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
4771 use arbitrary::{Arbitrary, Unstructured};
4772 let mut buf = [0u8; 1024];
4773 rng.fill_bytes(&mut buf);
4774 let mut unstructured = Unstructured::new(&buf);
4775 Self::arbitrary(&mut unstructured).unwrap_or_default()
4776 }
4777}
4778impl Default for ADSB_VEHICLE_DATA {
4779 fn default() -> Self {
4780 Self::DEFAULT.clone()
4781 }
4782}
4783impl MessageData for ADSB_VEHICLE_DATA {
4784 type Message = MavMessage;
4785 const ID: u32 = 246u32;
4786 const NAME: &'static str = "ADSB_VEHICLE";
4787 const EXTRA_CRC: u8 = 184u8;
4788 const ENCODED_LEN: usize = 38usize;
4789 fn deser(
4790 _version: MavlinkVersion,
4791 __input: &[u8],
4792 ) -> Result<Self, ::mavlink_core::error::ParserError> {
4793 let avail_len = __input.len();
4794 let mut payload_buf = [0; Self::ENCODED_LEN];
4795 let mut buf = if avail_len < Self::ENCODED_LEN {
4796 payload_buf[0..avail_len].copy_from_slice(__input);
4797 Bytes::new(&payload_buf)
4798 } else {
4799 Bytes::new(__input)
4800 };
4801 let mut __struct = Self::default();
4802 __struct.ICAO_address = buf.get_u32_le();
4803 __struct.lat = buf.get_i32_le();
4804 __struct.lon = buf.get_i32_le();
4805 __struct.altitude = buf.get_i32_le();
4806 __struct.heading = buf.get_u16_le();
4807 __struct.hor_velocity = buf.get_u16_le();
4808 __struct.ver_velocity = buf.get_i16_le();
4809 let tmp = buf.get_u16_le();
4810 __struct.flags = AdsbFlags::from_bits(tmp & AdsbFlags::all().bits()).ok_or(
4811 ::mavlink_core::error::ParserError::InvalidFlag {
4812 flag_type: "AdsbFlags",
4813 value: tmp as u32,
4814 },
4815 )?;
4816 __struct.squawk = buf.get_u16_le();
4817 let tmp = buf.get_u8();
4818 __struct.altitude_type =
4819 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
4820 enum_type: "AdsbAltitudeType",
4821 value: tmp as u32,
4822 })?;
4823 for v in &mut __struct.callsign {
4824 let val = buf.get_u8();
4825 *v = val;
4826 }
4827 let tmp = buf.get_u8();
4828 __struct.emitter_type =
4829 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
4830 enum_type: "AdsbEmitterType",
4831 value: tmp as u32,
4832 })?;
4833 __struct.tslc = buf.get_u8();
4834 Ok(__struct)
4835 }
4836 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
4837 let mut __tmp = BytesMut::new(bytes);
4838 #[allow(clippy::absurd_extreme_comparisons)]
4839 #[allow(unused_comparisons)]
4840 if __tmp.remaining() < Self::ENCODED_LEN {
4841 panic!(
4842 "buffer is too small (need {} bytes, but got {})",
4843 Self::ENCODED_LEN,
4844 __tmp.remaining(),
4845 )
4846 }
4847 __tmp.put_u32_le(self.ICAO_address);
4848 __tmp.put_i32_le(self.lat);
4849 __tmp.put_i32_le(self.lon);
4850 __tmp.put_i32_le(self.altitude);
4851 __tmp.put_u16_le(self.heading);
4852 __tmp.put_u16_le(self.hor_velocity);
4853 __tmp.put_i16_le(self.ver_velocity);
4854 __tmp.put_u16_le(self.flags.bits());
4855 __tmp.put_u16_le(self.squawk);
4856 __tmp.put_u8(self.altitude_type as u8);
4857 for val in &self.callsign {
4858 __tmp.put_u8(*val);
4859 }
4860 __tmp.put_u8(self.emitter_type as u8);
4861 __tmp.put_u8(self.tslc);
4862 if matches!(version, MavlinkVersion::V2) {
4863 let len = __tmp.len();
4864 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
4865 } else {
4866 __tmp.len()
4867 }
4868 }
4869}
4870#[doc = "The location and information of an AIS vessel."]
4871#[doc = ""]
4872#[doc = "ID: 301"]
4873#[derive(Debug, Clone, PartialEq)]
4874#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
4875#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
4876pub struct AIS_VESSEL_DATA {
4877 #[doc = "Mobile Marine Service Identifier, 9 decimal digits"]
4878 pub MMSI: u32,
4879 #[doc = "Latitude"]
4880 pub lat: i32,
4881 #[doc = "Longitude"]
4882 pub lon: i32,
4883 #[doc = "Course over ground"]
4884 pub COG: u16,
4885 #[doc = "True heading"]
4886 pub heading: u16,
4887 #[doc = "Speed over ground"]
4888 pub velocity: u16,
4889 #[doc = "Distance from lat/lon location to bow"]
4890 pub dimension_bow: u16,
4891 #[doc = "Distance from lat/lon location to stern"]
4892 pub dimension_stern: u16,
4893 #[doc = "Time since last communication in seconds"]
4894 pub tslc: u16,
4895 #[doc = "Bitmask to indicate various statuses including valid data fields"]
4896 pub flags: AisFlags,
4897 #[doc = "Turn rate"]
4898 pub turn_rate: i8,
4899 #[doc = "Navigational status"]
4900 pub navigational_status: AisNavStatus,
4901 #[doc = "Type of vessels"]
4902 pub mavtype: AisType,
4903 #[doc = "Distance from lat/lon location to port side"]
4904 pub dimension_port: u8,
4905 #[doc = "Distance from lat/lon location to starboard side"]
4906 pub dimension_starboard: u8,
4907 #[doc = "The vessel callsign"]
4908 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
4909 pub callsign: [u8; 7],
4910 #[doc = "The vessel name"]
4911 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
4912 pub name: [u8; 20],
4913}
4914impl AIS_VESSEL_DATA {
4915 pub const ENCODED_LEN: usize = 58usize;
4916 pub const DEFAULT: Self = Self {
4917 MMSI: 0_u32,
4918 lat: 0_i32,
4919 lon: 0_i32,
4920 COG: 0_u16,
4921 heading: 0_u16,
4922 velocity: 0_u16,
4923 dimension_bow: 0_u16,
4924 dimension_stern: 0_u16,
4925 tslc: 0_u16,
4926 flags: AisFlags::DEFAULT,
4927 turn_rate: 0_i8,
4928 navigational_status: AisNavStatus::DEFAULT,
4929 mavtype: AisType::DEFAULT,
4930 dimension_port: 0_u8,
4931 dimension_starboard: 0_u8,
4932 callsign: [0_u8; 7usize],
4933 name: [0_u8; 20usize],
4934 };
4935 #[cfg(feature = "arbitrary")]
4936 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
4937 use arbitrary::{Arbitrary, Unstructured};
4938 let mut buf = [0u8; 1024];
4939 rng.fill_bytes(&mut buf);
4940 let mut unstructured = Unstructured::new(&buf);
4941 Self::arbitrary(&mut unstructured).unwrap_or_default()
4942 }
4943}
4944impl Default for AIS_VESSEL_DATA {
4945 fn default() -> Self {
4946 Self::DEFAULT.clone()
4947 }
4948}
4949impl MessageData for AIS_VESSEL_DATA {
4950 type Message = MavMessage;
4951 const ID: u32 = 301u32;
4952 const NAME: &'static str = "AIS_VESSEL";
4953 const EXTRA_CRC: u8 = 243u8;
4954 const ENCODED_LEN: usize = 58usize;
4955 fn deser(
4956 _version: MavlinkVersion,
4957 __input: &[u8],
4958 ) -> Result<Self, ::mavlink_core::error::ParserError> {
4959 let avail_len = __input.len();
4960 let mut payload_buf = [0; Self::ENCODED_LEN];
4961 let mut buf = if avail_len < Self::ENCODED_LEN {
4962 payload_buf[0..avail_len].copy_from_slice(__input);
4963 Bytes::new(&payload_buf)
4964 } else {
4965 Bytes::new(__input)
4966 };
4967 let mut __struct = Self::default();
4968 __struct.MMSI = buf.get_u32_le();
4969 __struct.lat = buf.get_i32_le();
4970 __struct.lon = buf.get_i32_le();
4971 __struct.COG = buf.get_u16_le();
4972 __struct.heading = buf.get_u16_le();
4973 __struct.velocity = buf.get_u16_le();
4974 __struct.dimension_bow = buf.get_u16_le();
4975 __struct.dimension_stern = buf.get_u16_le();
4976 __struct.tslc = buf.get_u16_le();
4977 let tmp = buf.get_u16_le();
4978 __struct.flags = AisFlags::from_bits(tmp & AisFlags::all().bits()).ok_or(
4979 ::mavlink_core::error::ParserError::InvalidFlag {
4980 flag_type: "AisFlags",
4981 value: tmp as u32,
4982 },
4983 )?;
4984 __struct.turn_rate = buf.get_i8();
4985 let tmp = buf.get_u8();
4986 __struct.navigational_status =
4987 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
4988 enum_type: "AisNavStatus",
4989 value: tmp as u32,
4990 })?;
4991 let tmp = buf.get_u8();
4992 __struct.mavtype =
4993 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
4994 enum_type: "AisType",
4995 value: tmp as u32,
4996 })?;
4997 __struct.dimension_port = buf.get_u8();
4998 __struct.dimension_starboard = buf.get_u8();
4999 for v in &mut __struct.callsign {
5000 let val = buf.get_u8();
5001 *v = val;
5002 }
5003 for v in &mut __struct.name {
5004 let val = buf.get_u8();
5005 *v = val;
5006 }
5007 Ok(__struct)
5008 }
5009 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
5010 let mut __tmp = BytesMut::new(bytes);
5011 #[allow(clippy::absurd_extreme_comparisons)]
5012 #[allow(unused_comparisons)]
5013 if __tmp.remaining() < Self::ENCODED_LEN {
5014 panic!(
5015 "buffer is too small (need {} bytes, but got {})",
5016 Self::ENCODED_LEN,
5017 __tmp.remaining(),
5018 )
5019 }
5020 __tmp.put_u32_le(self.MMSI);
5021 __tmp.put_i32_le(self.lat);
5022 __tmp.put_i32_le(self.lon);
5023 __tmp.put_u16_le(self.COG);
5024 __tmp.put_u16_le(self.heading);
5025 __tmp.put_u16_le(self.velocity);
5026 __tmp.put_u16_le(self.dimension_bow);
5027 __tmp.put_u16_le(self.dimension_stern);
5028 __tmp.put_u16_le(self.tslc);
5029 __tmp.put_u16_le(self.flags.bits());
5030 __tmp.put_i8(self.turn_rate);
5031 __tmp.put_u8(self.navigational_status as u8);
5032 __tmp.put_u8(self.mavtype as u8);
5033 __tmp.put_u8(self.dimension_port);
5034 __tmp.put_u8(self.dimension_starboard);
5035 for val in &self.callsign {
5036 __tmp.put_u8(*val);
5037 }
5038 for val in &self.name {
5039 __tmp.put_u8(*val);
5040 }
5041 if matches!(version, MavlinkVersion::V2) {
5042 let len = __tmp.len();
5043 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
5044 } else {
5045 __tmp.len()
5046 }
5047 }
5048}
5049#[doc = "The current system altitude."]
5050#[doc = ""]
5051#[doc = "ID: 141"]
5052#[derive(Debug, Clone, PartialEq)]
5053#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
5054#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
5055pub struct ALTITUDE_DATA {
5056 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
5057 pub time_usec: u64,
5058 #[doc = "This altitude measure is initialized on system boot and monotonic (it is never reset, but represents the local altitude change). The only guarantee on this field is that it will never be reset and is consistent within a flight. The recommended value for this field is the uncorrected barometric altitude at boot time. This altitude will also drift and vary between flights."]
5059 pub altitude_monotonic: f32,
5060 #[doc = "This altitude measure is strictly above mean sea level and might be non-monotonic (it might reset on events like GPS lock or when a new QNH value is set). It should be the altitude to which global altitude waypoints are compared to. Note that it is *not* the GPS altitude, however, most GPS modules already output MSL by default and not the WGS84 altitude."]
5061 pub altitude_amsl: f32,
5062 #[doc = "This is the local altitude in the local coordinate frame. It is not the altitude above home, but in reference to the coordinate origin (0, 0, 0). It is up-positive."]
5063 pub altitude_local: f32,
5064 #[doc = "This is the altitude above the home position. It resets on each change of the current home position."]
5065 pub altitude_relative: f32,
5066 #[doc = "This is the altitude above terrain. It might be fed by a terrain database or an altimeter. Values smaller than -1000 should be interpreted as unknown."]
5067 pub altitude_terrain: f32,
5068 #[doc = "This is not the altitude, but the clear space below the system according to the fused clearance estimate. It generally should max out at the maximum range of e.g. the laser altimeter. It is generally a moving target. A negative value indicates no measurement available."]
5069 pub bottom_clearance: f32,
5070}
5071impl ALTITUDE_DATA {
5072 pub const ENCODED_LEN: usize = 32usize;
5073 pub const DEFAULT: Self = Self {
5074 time_usec: 0_u64,
5075 altitude_monotonic: 0.0_f32,
5076 altitude_amsl: 0.0_f32,
5077 altitude_local: 0.0_f32,
5078 altitude_relative: 0.0_f32,
5079 altitude_terrain: 0.0_f32,
5080 bottom_clearance: 0.0_f32,
5081 };
5082 #[cfg(feature = "arbitrary")]
5083 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
5084 use arbitrary::{Arbitrary, Unstructured};
5085 let mut buf = [0u8; 1024];
5086 rng.fill_bytes(&mut buf);
5087 let mut unstructured = Unstructured::new(&buf);
5088 Self::arbitrary(&mut unstructured).unwrap_or_default()
5089 }
5090}
5091impl Default for ALTITUDE_DATA {
5092 fn default() -> Self {
5093 Self::DEFAULT.clone()
5094 }
5095}
5096impl MessageData for ALTITUDE_DATA {
5097 type Message = MavMessage;
5098 const ID: u32 = 141u32;
5099 const NAME: &'static str = "ALTITUDE";
5100 const EXTRA_CRC: u8 = 47u8;
5101 const ENCODED_LEN: usize = 32usize;
5102 fn deser(
5103 _version: MavlinkVersion,
5104 __input: &[u8],
5105 ) -> Result<Self, ::mavlink_core::error::ParserError> {
5106 let avail_len = __input.len();
5107 let mut payload_buf = [0; Self::ENCODED_LEN];
5108 let mut buf = if avail_len < Self::ENCODED_LEN {
5109 payload_buf[0..avail_len].copy_from_slice(__input);
5110 Bytes::new(&payload_buf)
5111 } else {
5112 Bytes::new(__input)
5113 };
5114 let mut __struct = Self::default();
5115 __struct.time_usec = buf.get_u64_le();
5116 __struct.altitude_monotonic = buf.get_f32_le();
5117 __struct.altitude_amsl = buf.get_f32_le();
5118 __struct.altitude_local = buf.get_f32_le();
5119 __struct.altitude_relative = buf.get_f32_le();
5120 __struct.altitude_terrain = buf.get_f32_le();
5121 __struct.bottom_clearance = buf.get_f32_le();
5122 Ok(__struct)
5123 }
5124 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
5125 let mut __tmp = BytesMut::new(bytes);
5126 #[allow(clippy::absurd_extreme_comparisons)]
5127 #[allow(unused_comparisons)]
5128 if __tmp.remaining() < Self::ENCODED_LEN {
5129 panic!(
5130 "buffer is too small (need {} bytes, but got {})",
5131 Self::ENCODED_LEN,
5132 __tmp.remaining(),
5133 )
5134 }
5135 __tmp.put_u64_le(self.time_usec);
5136 __tmp.put_f32_le(self.altitude_monotonic);
5137 __tmp.put_f32_le(self.altitude_amsl);
5138 __tmp.put_f32_le(self.altitude_local);
5139 __tmp.put_f32_le(self.altitude_relative);
5140 __tmp.put_f32_le(self.altitude_terrain);
5141 __tmp.put_f32_le(self.bottom_clearance);
5142 if matches!(version, MavlinkVersion::V2) {
5143 let len = __tmp.len();
5144 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
5145 } else {
5146 __tmp.len()
5147 }
5148 }
5149}
5150#[doc = "The attitude in the aeronautical frame (right-handed, Z-down, Y-right, X-front, ZYX, intrinsic)."]
5151#[doc = ""]
5152#[doc = "ID: 30"]
5153#[derive(Debug, Clone, PartialEq)]
5154#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
5155#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
5156pub struct ATTITUDE_DATA {
5157 #[doc = "Timestamp (time since system boot)."]
5158 pub time_boot_ms: u32,
5159 #[doc = "Roll angle (-pi..+pi)"]
5160 pub roll: f32,
5161 #[doc = "Pitch angle (-pi..+pi)"]
5162 pub pitch: f32,
5163 #[doc = "Yaw angle (-pi..+pi)"]
5164 pub yaw: f32,
5165 #[doc = "Roll angular speed"]
5166 pub rollspeed: f32,
5167 #[doc = "Pitch angular speed"]
5168 pub pitchspeed: f32,
5169 #[doc = "Yaw angular speed"]
5170 pub yawspeed: f32,
5171}
5172impl ATTITUDE_DATA {
5173 pub const ENCODED_LEN: usize = 28usize;
5174 pub const DEFAULT: Self = Self {
5175 time_boot_ms: 0_u32,
5176 roll: 0.0_f32,
5177 pitch: 0.0_f32,
5178 yaw: 0.0_f32,
5179 rollspeed: 0.0_f32,
5180 pitchspeed: 0.0_f32,
5181 yawspeed: 0.0_f32,
5182 };
5183 #[cfg(feature = "arbitrary")]
5184 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
5185 use arbitrary::{Arbitrary, Unstructured};
5186 let mut buf = [0u8; 1024];
5187 rng.fill_bytes(&mut buf);
5188 let mut unstructured = Unstructured::new(&buf);
5189 Self::arbitrary(&mut unstructured).unwrap_or_default()
5190 }
5191}
5192impl Default for ATTITUDE_DATA {
5193 fn default() -> Self {
5194 Self::DEFAULT.clone()
5195 }
5196}
5197impl MessageData for ATTITUDE_DATA {
5198 type Message = MavMessage;
5199 const ID: u32 = 30u32;
5200 const NAME: &'static str = "ATTITUDE";
5201 const EXTRA_CRC: u8 = 39u8;
5202 const ENCODED_LEN: usize = 28usize;
5203 fn deser(
5204 _version: MavlinkVersion,
5205 __input: &[u8],
5206 ) -> Result<Self, ::mavlink_core::error::ParserError> {
5207 let avail_len = __input.len();
5208 let mut payload_buf = [0; Self::ENCODED_LEN];
5209 let mut buf = if avail_len < Self::ENCODED_LEN {
5210 payload_buf[0..avail_len].copy_from_slice(__input);
5211 Bytes::new(&payload_buf)
5212 } else {
5213 Bytes::new(__input)
5214 };
5215 let mut __struct = Self::default();
5216 __struct.time_boot_ms = buf.get_u32_le();
5217 __struct.roll = buf.get_f32_le();
5218 __struct.pitch = buf.get_f32_le();
5219 __struct.yaw = buf.get_f32_le();
5220 __struct.rollspeed = buf.get_f32_le();
5221 __struct.pitchspeed = buf.get_f32_le();
5222 __struct.yawspeed = buf.get_f32_le();
5223 Ok(__struct)
5224 }
5225 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
5226 let mut __tmp = BytesMut::new(bytes);
5227 #[allow(clippy::absurd_extreme_comparisons)]
5228 #[allow(unused_comparisons)]
5229 if __tmp.remaining() < Self::ENCODED_LEN {
5230 panic!(
5231 "buffer is too small (need {} bytes, but got {})",
5232 Self::ENCODED_LEN,
5233 __tmp.remaining(),
5234 )
5235 }
5236 __tmp.put_u32_le(self.time_boot_ms);
5237 __tmp.put_f32_le(self.roll);
5238 __tmp.put_f32_le(self.pitch);
5239 __tmp.put_f32_le(self.yaw);
5240 __tmp.put_f32_le(self.rollspeed);
5241 __tmp.put_f32_le(self.pitchspeed);
5242 __tmp.put_f32_le(self.yawspeed);
5243 if matches!(version, MavlinkVersion::V2) {
5244 let len = __tmp.len();
5245 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
5246 } else {
5247 __tmp.len()
5248 }
5249 }
5250}
5251#[doc = "The attitude in the aeronautical frame (right-handed, Z-down, X-front, Y-right), expressed as quaternion. Quaternion order is w, x, y, z and a zero rotation would be expressed as (1 0 0 0)."]
5252#[doc = ""]
5253#[doc = "ID: 31"]
5254#[derive(Debug, Clone, PartialEq)]
5255#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
5256#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
5257pub struct ATTITUDE_QUATERNION_DATA {
5258 #[doc = "Timestamp (time since system boot)."]
5259 pub time_boot_ms: u32,
5260 #[doc = "Quaternion component 1, w (1 in null-rotation)"]
5261 pub q1: f32,
5262 #[doc = "Quaternion component 2, x (0 in null-rotation)"]
5263 pub q2: f32,
5264 #[doc = "Quaternion component 3, y (0 in null-rotation)"]
5265 pub q3: f32,
5266 #[doc = "Quaternion component 4, z (0 in null-rotation)"]
5267 pub q4: f32,
5268 #[doc = "Roll angular speed"]
5269 pub rollspeed: f32,
5270 #[doc = "Pitch angular speed"]
5271 pub pitchspeed: f32,
5272 #[doc = "Yaw angular speed"]
5273 pub yawspeed: f32,
5274 #[doc = "Rotation offset by which the attitude quaternion and angular speed vector should be rotated for user display (quaternion with [w, x, y, z] order, zero-rotation is [1, 0, 0, 0], send [0, 0, 0, 0] if field not supported). This field is intended for systems in which the reference attitude may change during flight. For example, tailsitters VTOLs rotate their reference attitude by 90 degrees between hover mode and fixed wing mode, thus repr_offset_q is equal to [1, 0, 0, 0] in hover mode and equal to [0.7071, 0, 0.7071, 0] in fixed wing mode."]
5275 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
5276 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
5277 pub repr_offset_q: [f32; 4],
5278}
5279impl ATTITUDE_QUATERNION_DATA {
5280 pub const ENCODED_LEN: usize = 48usize;
5281 pub const DEFAULT: Self = Self {
5282 time_boot_ms: 0_u32,
5283 q1: 0.0_f32,
5284 q2: 0.0_f32,
5285 q3: 0.0_f32,
5286 q4: 0.0_f32,
5287 rollspeed: 0.0_f32,
5288 pitchspeed: 0.0_f32,
5289 yawspeed: 0.0_f32,
5290 repr_offset_q: [0.0_f32; 4usize],
5291 };
5292 #[cfg(feature = "arbitrary")]
5293 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
5294 use arbitrary::{Arbitrary, Unstructured};
5295 let mut buf = [0u8; 1024];
5296 rng.fill_bytes(&mut buf);
5297 let mut unstructured = Unstructured::new(&buf);
5298 Self::arbitrary(&mut unstructured).unwrap_or_default()
5299 }
5300}
5301impl Default for ATTITUDE_QUATERNION_DATA {
5302 fn default() -> Self {
5303 Self::DEFAULT.clone()
5304 }
5305}
5306impl MessageData for ATTITUDE_QUATERNION_DATA {
5307 type Message = MavMessage;
5308 const ID: u32 = 31u32;
5309 const NAME: &'static str = "ATTITUDE_QUATERNION";
5310 const EXTRA_CRC: u8 = 246u8;
5311 const ENCODED_LEN: usize = 48usize;
5312 fn deser(
5313 _version: MavlinkVersion,
5314 __input: &[u8],
5315 ) -> Result<Self, ::mavlink_core::error::ParserError> {
5316 let avail_len = __input.len();
5317 let mut payload_buf = [0; Self::ENCODED_LEN];
5318 let mut buf = if avail_len < Self::ENCODED_LEN {
5319 payload_buf[0..avail_len].copy_from_slice(__input);
5320 Bytes::new(&payload_buf)
5321 } else {
5322 Bytes::new(__input)
5323 };
5324 let mut __struct = Self::default();
5325 __struct.time_boot_ms = buf.get_u32_le();
5326 __struct.q1 = buf.get_f32_le();
5327 __struct.q2 = buf.get_f32_le();
5328 __struct.q3 = buf.get_f32_le();
5329 __struct.q4 = buf.get_f32_le();
5330 __struct.rollspeed = buf.get_f32_le();
5331 __struct.pitchspeed = buf.get_f32_le();
5332 __struct.yawspeed = buf.get_f32_le();
5333 for v in &mut __struct.repr_offset_q {
5334 let val = buf.get_f32_le();
5335 *v = val;
5336 }
5337 Ok(__struct)
5338 }
5339 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
5340 let mut __tmp = BytesMut::new(bytes);
5341 #[allow(clippy::absurd_extreme_comparisons)]
5342 #[allow(unused_comparisons)]
5343 if __tmp.remaining() < Self::ENCODED_LEN {
5344 panic!(
5345 "buffer is too small (need {} bytes, but got {})",
5346 Self::ENCODED_LEN,
5347 __tmp.remaining(),
5348 )
5349 }
5350 __tmp.put_u32_le(self.time_boot_ms);
5351 __tmp.put_f32_le(self.q1);
5352 __tmp.put_f32_le(self.q2);
5353 __tmp.put_f32_le(self.q3);
5354 __tmp.put_f32_le(self.q4);
5355 __tmp.put_f32_le(self.rollspeed);
5356 __tmp.put_f32_le(self.pitchspeed);
5357 __tmp.put_f32_le(self.yawspeed);
5358 if matches!(version, MavlinkVersion::V2) {
5359 for val in &self.repr_offset_q {
5360 __tmp.put_f32_le(*val);
5361 }
5362 let len = __tmp.len();
5363 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
5364 } else {
5365 __tmp.len()
5366 }
5367 }
5368}
5369#[doc = "The attitude in the aeronautical frame (right-handed, Z-down, X-front, Y-right), expressed as quaternion. Quaternion order is w, x, y, z and a zero rotation would be expressed as (1 0 0 0)."]
5370#[doc = ""]
5371#[doc = "ID: 61"]
5372#[derive(Debug, Clone, PartialEq)]
5373#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
5374#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
5375pub struct ATTITUDE_QUATERNION_COV_DATA {
5376 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
5377 pub time_usec: u64,
5378 #[doc = "Quaternion components, w, x, y, z (1 0 0 0 is the null-rotation)"]
5379 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
5380 pub q: [f32; 4],
5381 #[doc = "Roll angular speed"]
5382 pub rollspeed: f32,
5383 #[doc = "Pitch angular speed"]
5384 pub pitchspeed: f32,
5385 #[doc = "Yaw angular speed"]
5386 pub yawspeed: f32,
5387 #[doc = "Row-major representation of a 3x3 attitude covariance matrix (states: roll, pitch, yaw; first three entries are the first ROW, next three entries are the second row, etc.). If unknown, assign NaN value to first element in the array."]
5388 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
5389 pub covariance: [f32; 9],
5390}
5391impl ATTITUDE_QUATERNION_COV_DATA {
5392 pub const ENCODED_LEN: usize = 72usize;
5393 pub const DEFAULT: Self = Self {
5394 time_usec: 0_u64,
5395 q: [0.0_f32; 4usize],
5396 rollspeed: 0.0_f32,
5397 pitchspeed: 0.0_f32,
5398 yawspeed: 0.0_f32,
5399 covariance: [0.0_f32; 9usize],
5400 };
5401 #[cfg(feature = "arbitrary")]
5402 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
5403 use arbitrary::{Arbitrary, Unstructured};
5404 let mut buf = [0u8; 1024];
5405 rng.fill_bytes(&mut buf);
5406 let mut unstructured = Unstructured::new(&buf);
5407 Self::arbitrary(&mut unstructured).unwrap_or_default()
5408 }
5409}
5410impl Default for ATTITUDE_QUATERNION_COV_DATA {
5411 fn default() -> Self {
5412 Self::DEFAULT.clone()
5413 }
5414}
5415impl MessageData for ATTITUDE_QUATERNION_COV_DATA {
5416 type Message = MavMessage;
5417 const ID: u32 = 61u32;
5418 const NAME: &'static str = "ATTITUDE_QUATERNION_COV";
5419 const EXTRA_CRC: u8 = 167u8;
5420 const ENCODED_LEN: usize = 72usize;
5421 fn deser(
5422 _version: MavlinkVersion,
5423 __input: &[u8],
5424 ) -> Result<Self, ::mavlink_core::error::ParserError> {
5425 let avail_len = __input.len();
5426 let mut payload_buf = [0; Self::ENCODED_LEN];
5427 let mut buf = if avail_len < Self::ENCODED_LEN {
5428 payload_buf[0..avail_len].copy_from_slice(__input);
5429 Bytes::new(&payload_buf)
5430 } else {
5431 Bytes::new(__input)
5432 };
5433 let mut __struct = Self::default();
5434 __struct.time_usec = buf.get_u64_le();
5435 for v in &mut __struct.q {
5436 let val = buf.get_f32_le();
5437 *v = val;
5438 }
5439 __struct.rollspeed = buf.get_f32_le();
5440 __struct.pitchspeed = buf.get_f32_le();
5441 __struct.yawspeed = buf.get_f32_le();
5442 for v in &mut __struct.covariance {
5443 let val = buf.get_f32_le();
5444 *v = val;
5445 }
5446 Ok(__struct)
5447 }
5448 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
5449 let mut __tmp = BytesMut::new(bytes);
5450 #[allow(clippy::absurd_extreme_comparisons)]
5451 #[allow(unused_comparisons)]
5452 if __tmp.remaining() < Self::ENCODED_LEN {
5453 panic!(
5454 "buffer is too small (need {} bytes, but got {})",
5455 Self::ENCODED_LEN,
5456 __tmp.remaining(),
5457 )
5458 }
5459 __tmp.put_u64_le(self.time_usec);
5460 for val in &self.q {
5461 __tmp.put_f32_le(*val);
5462 }
5463 __tmp.put_f32_le(self.rollspeed);
5464 __tmp.put_f32_le(self.pitchspeed);
5465 __tmp.put_f32_le(self.yawspeed);
5466 for val in &self.covariance {
5467 __tmp.put_f32_le(*val);
5468 }
5469 if matches!(version, MavlinkVersion::V2) {
5470 let len = __tmp.len();
5471 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
5472 } else {
5473 __tmp.len()
5474 }
5475 }
5476}
5477#[doc = "Reports the current commanded attitude of the vehicle as specified by the autopilot. This should match the commands sent in a SET_ATTITUDE_TARGET message if the vehicle is being controlled this way."]
5478#[doc = ""]
5479#[doc = "ID: 83"]
5480#[derive(Debug, Clone, PartialEq)]
5481#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
5482#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
5483pub struct ATTITUDE_TARGET_DATA {
5484 #[doc = "Timestamp (time since system boot)."]
5485 pub time_boot_ms: u32,
5486 #[doc = "Attitude quaternion (w, x, y, z order, zero-rotation is 1, 0, 0, 0)"]
5487 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
5488 pub q: [f32; 4],
5489 #[doc = "Body roll rate"]
5490 pub body_roll_rate: f32,
5491 #[doc = "Body pitch rate"]
5492 pub body_pitch_rate: f32,
5493 #[doc = "Body yaw rate"]
5494 pub body_yaw_rate: f32,
5495 #[doc = "Collective thrust, normalized to 0 .. 1 (-1 .. 1 for vehicles capable of reverse trust)"]
5496 pub thrust: f32,
5497 #[doc = "Bitmap to indicate which dimensions should be ignored by the vehicle."]
5498 pub type_mask: AttitudeTargetTypemask,
5499}
5500impl ATTITUDE_TARGET_DATA {
5501 pub const ENCODED_LEN: usize = 37usize;
5502 pub const DEFAULT: Self = Self {
5503 time_boot_ms: 0_u32,
5504 q: [0.0_f32; 4usize],
5505 body_roll_rate: 0.0_f32,
5506 body_pitch_rate: 0.0_f32,
5507 body_yaw_rate: 0.0_f32,
5508 thrust: 0.0_f32,
5509 type_mask: AttitudeTargetTypemask::DEFAULT,
5510 };
5511 #[cfg(feature = "arbitrary")]
5512 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
5513 use arbitrary::{Arbitrary, Unstructured};
5514 let mut buf = [0u8; 1024];
5515 rng.fill_bytes(&mut buf);
5516 let mut unstructured = Unstructured::new(&buf);
5517 Self::arbitrary(&mut unstructured).unwrap_or_default()
5518 }
5519}
5520impl Default for ATTITUDE_TARGET_DATA {
5521 fn default() -> Self {
5522 Self::DEFAULT.clone()
5523 }
5524}
5525impl MessageData for ATTITUDE_TARGET_DATA {
5526 type Message = MavMessage;
5527 const ID: u32 = 83u32;
5528 const NAME: &'static str = "ATTITUDE_TARGET";
5529 const EXTRA_CRC: u8 = 22u8;
5530 const ENCODED_LEN: usize = 37usize;
5531 fn deser(
5532 _version: MavlinkVersion,
5533 __input: &[u8],
5534 ) -> Result<Self, ::mavlink_core::error::ParserError> {
5535 let avail_len = __input.len();
5536 let mut payload_buf = [0; Self::ENCODED_LEN];
5537 let mut buf = if avail_len < Self::ENCODED_LEN {
5538 payload_buf[0..avail_len].copy_from_slice(__input);
5539 Bytes::new(&payload_buf)
5540 } else {
5541 Bytes::new(__input)
5542 };
5543 let mut __struct = Self::default();
5544 __struct.time_boot_ms = buf.get_u32_le();
5545 for v in &mut __struct.q {
5546 let val = buf.get_f32_le();
5547 *v = val;
5548 }
5549 __struct.body_roll_rate = buf.get_f32_le();
5550 __struct.body_pitch_rate = buf.get_f32_le();
5551 __struct.body_yaw_rate = buf.get_f32_le();
5552 __struct.thrust = buf.get_f32_le();
5553 let tmp = buf.get_u8();
5554 __struct.type_mask = AttitudeTargetTypemask::from_bits(
5555 tmp & AttitudeTargetTypemask::all().bits(),
5556 )
5557 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
5558 flag_type: "AttitudeTargetTypemask",
5559 value: tmp as u32,
5560 })?;
5561 Ok(__struct)
5562 }
5563 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
5564 let mut __tmp = BytesMut::new(bytes);
5565 #[allow(clippy::absurd_extreme_comparisons)]
5566 #[allow(unused_comparisons)]
5567 if __tmp.remaining() < Self::ENCODED_LEN {
5568 panic!(
5569 "buffer is too small (need {} bytes, but got {})",
5570 Self::ENCODED_LEN,
5571 __tmp.remaining(),
5572 )
5573 }
5574 __tmp.put_u32_le(self.time_boot_ms);
5575 for val in &self.q {
5576 __tmp.put_f32_le(*val);
5577 }
5578 __tmp.put_f32_le(self.body_roll_rate);
5579 __tmp.put_f32_le(self.body_pitch_rate);
5580 __tmp.put_f32_le(self.body_yaw_rate);
5581 __tmp.put_f32_le(self.thrust);
5582 __tmp.put_u8(self.type_mask.bits());
5583 if matches!(version, MavlinkVersion::V2) {
5584 let len = __tmp.len();
5585 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
5586 } else {
5587 __tmp.len()
5588 }
5589 }
5590}
5591#[doc = "Motion capture attitude and position."]
5592#[doc = ""]
5593#[doc = "ID: 138"]
5594#[derive(Debug, Clone, PartialEq)]
5595#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
5596#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
5597pub struct ATT_POS_MOCAP_DATA {
5598 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
5599 pub time_usec: u64,
5600 #[doc = "Attitude quaternion (w, x, y, z order, zero-rotation is 1, 0, 0, 0)"]
5601 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
5602 pub q: [f32; 4],
5603 #[doc = "X position (NED)"]
5604 pub x: f32,
5605 #[doc = "Y position (NED)"]
5606 pub y: f32,
5607 #[doc = "Z position (NED)"]
5608 pub z: f32,
5609 #[doc = "Row-major representation of a pose 6x6 cross-covariance matrix upper right triangle (states: x, y, z, roll, pitch, yaw; first six entries are the first ROW, next five entries are the second ROW, etc.). If unknown, assign NaN value to first element in the array."]
5610 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
5611 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
5612 pub covariance: [f32; 21],
5613}
5614impl ATT_POS_MOCAP_DATA {
5615 pub const ENCODED_LEN: usize = 120usize;
5616 pub const DEFAULT: Self = Self {
5617 time_usec: 0_u64,
5618 q: [0.0_f32; 4usize],
5619 x: 0.0_f32,
5620 y: 0.0_f32,
5621 z: 0.0_f32,
5622 covariance: [0.0_f32; 21usize],
5623 };
5624 #[cfg(feature = "arbitrary")]
5625 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
5626 use arbitrary::{Arbitrary, Unstructured};
5627 let mut buf = [0u8; 1024];
5628 rng.fill_bytes(&mut buf);
5629 let mut unstructured = Unstructured::new(&buf);
5630 Self::arbitrary(&mut unstructured).unwrap_or_default()
5631 }
5632}
5633impl Default for ATT_POS_MOCAP_DATA {
5634 fn default() -> Self {
5635 Self::DEFAULT.clone()
5636 }
5637}
5638impl MessageData for ATT_POS_MOCAP_DATA {
5639 type Message = MavMessage;
5640 const ID: u32 = 138u32;
5641 const NAME: &'static str = "ATT_POS_MOCAP";
5642 const EXTRA_CRC: u8 = 109u8;
5643 const ENCODED_LEN: usize = 120usize;
5644 fn deser(
5645 _version: MavlinkVersion,
5646 __input: &[u8],
5647 ) -> Result<Self, ::mavlink_core::error::ParserError> {
5648 let avail_len = __input.len();
5649 let mut payload_buf = [0; Self::ENCODED_LEN];
5650 let mut buf = if avail_len < Self::ENCODED_LEN {
5651 payload_buf[0..avail_len].copy_from_slice(__input);
5652 Bytes::new(&payload_buf)
5653 } else {
5654 Bytes::new(__input)
5655 };
5656 let mut __struct = Self::default();
5657 __struct.time_usec = buf.get_u64_le();
5658 for v in &mut __struct.q {
5659 let val = buf.get_f32_le();
5660 *v = val;
5661 }
5662 __struct.x = buf.get_f32_le();
5663 __struct.y = buf.get_f32_le();
5664 __struct.z = buf.get_f32_le();
5665 for v in &mut __struct.covariance {
5666 let val = buf.get_f32_le();
5667 *v = val;
5668 }
5669 Ok(__struct)
5670 }
5671 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
5672 let mut __tmp = BytesMut::new(bytes);
5673 #[allow(clippy::absurd_extreme_comparisons)]
5674 #[allow(unused_comparisons)]
5675 if __tmp.remaining() < Self::ENCODED_LEN {
5676 panic!(
5677 "buffer is too small (need {} bytes, but got {})",
5678 Self::ENCODED_LEN,
5679 __tmp.remaining(),
5680 )
5681 }
5682 __tmp.put_u64_le(self.time_usec);
5683 for val in &self.q {
5684 __tmp.put_f32_le(*val);
5685 }
5686 __tmp.put_f32_le(self.x);
5687 __tmp.put_f32_le(self.y);
5688 __tmp.put_f32_le(self.z);
5689 if matches!(version, MavlinkVersion::V2) {
5690 for val in &self.covariance {
5691 __tmp.put_f32_le(*val);
5692 }
5693 let len = __tmp.len();
5694 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
5695 } else {
5696 __tmp.len()
5697 }
5698 }
5699}
5700#[doc = "Emit an encrypted signature / key identifying this system. PLEASE NOTE: This protocol has been kept simple, so transmitting the key requires an encrypted channel for true safety."]
5701#[doc = ""]
5702#[doc = "ID: 7"]
5703#[derive(Debug, Clone, PartialEq)]
5704#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
5705#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
5706pub struct AUTH_KEY_DATA {
5707 #[doc = "key"]
5708 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
5709 pub key: [u8; 32],
5710}
5711impl AUTH_KEY_DATA {
5712 pub const ENCODED_LEN: usize = 32usize;
5713 pub const DEFAULT: Self = Self {
5714 key: [0_u8; 32usize],
5715 };
5716 #[cfg(feature = "arbitrary")]
5717 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
5718 use arbitrary::{Arbitrary, Unstructured};
5719 let mut buf = [0u8; 1024];
5720 rng.fill_bytes(&mut buf);
5721 let mut unstructured = Unstructured::new(&buf);
5722 Self::arbitrary(&mut unstructured).unwrap_or_default()
5723 }
5724}
5725impl Default for AUTH_KEY_DATA {
5726 fn default() -> Self {
5727 Self::DEFAULT.clone()
5728 }
5729}
5730impl MessageData for AUTH_KEY_DATA {
5731 type Message = MavMessage;
5732 const ID: u32 = 7u32;
5733 const NAME: &'static str = "AUTH_KEY";
5734 const EXTRA_CRC: u8 = 119u8;
5735 const ENCODED_LEN: usize = 32usize;
5736 fn deser(
5737 _version: MavlinkVersion,
5738 __input: &[u8],
5739 ) -> Result<Self, ::mavlink_core::error::ParserError> {
5740 let avail_len = __input.len();
5741 let mut payload_buf = [0; Self::ENCODED_LEN];
5742 let mut buf = if avail_len < Self::ENCODED_LEN {
5743 payload_buf[0..avail_len].copy_from_slice(__input);
5744 Bytes::new(&payload_buf)
5745 } else {
5746 Bytes::new(__input)
5747 };
5748 let mut __struct = Self::default();
5749 for v in &mut __struct.key {
5750 let val = buf.get_u8();
5751 *v = val;
5752 }
5753 Ok(__struct)
5754 }
5755 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
5756 let mut __tmp = BytesMut::new(bytes);
5757 #[allow(clippy::absurd_extreme_comparisons)]
5758 #[allow(unused_comparisons)]
5759 if __tmp.remaining() < Self::ENCODED_LEN {
5760 panic!(
5761 "buffer is too small (need {} bytes, but got {})",
5762 Self::ENCODED_LEN,
5763 __tmp.remaining(),
5764 )
5765 }
5766 for val in &self.key {
5767 __tmp.put_u8(*val);
5768 }
5769 if matches!(version, MavlinkVersion::V2) {
5770 let len = __tmp.len();
5771 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
5772 } else {
5773 __tmp.len()
5774 }
5775 }
5776}
5777#[doc = "Low level message containing autopilot state relevant for a gimbal device. This message is to be sent from the autopilot to the gimbal device component. The data of this message are for the gimbal device's estimator corrections, in particular horizon compensation, as well as indicates autopilot control intentions, e.g. feed forward angular control in the z-axis."]
5778#[doc = ""]
5779#[doc = "ID: 286"]
5780#[derive(Debug, Clone, PartialEq)]
5781#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
5782#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
5783pub struct AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA {
5784 #[doc = "Timestamp (time since system boot)."]
5785 pub time_boot_us: u64,
5786 #[doc = "Quaternion components of autopilot attitude: w, x, y, z (1 0 0 0 is the null-rotation, Hamilton convention)."]
5787 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
5788 pub q: [f32; 4],
5789 #[doc = "Estimated delay of the attitude data. 0 if unknown."]
5790 pub q_estimated_delay_us: u32,
5791 #[doc = "X Speed in NED (North, East, Down). NAN if unknown."]
5792 pub vx: f32,
5793 #[doc = "Y Speed in NED (North, East, Down). NAN if unknown."]
5794 pub vy: f32,
5795 #[doc = "Z Speed in NED (North, East, Down). NAN if unknown."]
5796 pub vz: f32,
5797 #[doc = "Estimated delay of the speed data. 0 if unknown."]
5798 pub v_estimated_delay_us: u32,
5799 #[doc = "Feed forward Z component of angular velocity (positive: yawing to the right). NaN to be ignored. This is to indicate if the autopilot is actively yawing."]
5800 pub feed_forward_angular_velocity_z: f32,
5801 #[doc = "Bitmap indicating which estimator outputs are valid."]
5802 pub estimator_status: EstimatorStatusFlags,
5803 #[doc = "System ID"]
5804 pub target_system: u8,
5805 #[doc = "Component ID"]
5806 pub target_component: u8,
5807 #[doc = "The landed state. Is set to MAV_LANDED_STATE_UNDEFINED if landed state is unknown."]
5808 pub landed_state: MavLandedState,
5809 #[doc = "Z component of angular velocity in NED (North, East, Down). NaN if unknown."]
5810 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
5811 pub angular_velocity_z: f32,
5812}
5813impl AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA {
5814 pub const ENCODED_LEN: usize = 57usize;
5815 pub const DEFAULT: Self = Self {
5816 time_boot_us: 0_u64,
5817 q: [0.0_f32; 4usize],
5818 q_estimated_delay_us: 0_u32,
5819 vx: 0.0_f32,
5820 vy: 0.0_f32,
5821 vz: 0.0_f32,
5822 v_estimated_delay_us: 0_u32,
5823 feed_forward_angular_velocity_z: 0.0_f32,
5824 estimator_status: EstimatorStatusFlags::DEFAULT,
5825 target_system: 0_u8,
5826 target_component: 0_u8,
5827 landed_state: MavLandedState::DEFAULT,
5828 angular_velocity_z: 0.0_f32,
5829 };
5830 #[cfg(feature = "arbitrary")]
5831 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
5832 use arbitrary::{Arbitrary, Unstructured};
5833 let mut buf = [0u8; 1024];
5834 rng.fill_bytes(&mut buf);
5835 let mut unstructured = Unstructured::new(&buf);
5836 Self::arbitrary(&mut unstructured).unwrap_or_default()
5837 }
5838}
5839impl Default for AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA {
5840 fn default() -> Self {
5841 Self::DEFAULT.clone()
5842 }
5843}
5844impl MessageData for AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA {
5845 type Message = MavMessage;
5846 const ID: u32 = 286u32;
5847 const NAME: &'static str = "AUTOPILOT_STATE_FOR_GIMBAL_DEVICE";
5848 const EXTRA_CRC: u8 = 210u8;
5849 const ENCODED_LEN: usize = 57usize;
5850 fn deser(
5851 _version: MavlinkVersion,
5852 __input: &[u8],
5853 ) -> Result<Self, ::mavlink_core::error::ParserError> {
5854 let avail_len = __input.len();
5855 let mut payload_buf = [0; Self::ENCODED_LEN];
5856 let mut buf = if avail_len < Self::ENCODED_LEN {
5857 payload_buf[0..avail_len].copy_from_slice(__input);
5858 Bytes::new(&payload_buf)
5859 } else {
5860 Bytes::new(__input)
5861 };
5862 let mut __struct = Self::default();
5863 __struct.time_boot_us = buf.get_u64_le();
5864 for v in &mut __struct.q {
5865 let val = buf.get_f32_le();
5866 *v = val;
5867 }
5868 __struct.q_estimated_delay_us = buf.get_u32_le();
5869 __struct.vx = buf.get_f32_le();
5870 __struct.vy = buf.get_f32_le();
5871 __struct.vz = buf.get_f32_le();
5872 __struct.v_estimated_delay_us = buf.get_u32_le();
5873 __struct.feed_forward_angular_velocity_z = buf.get_f32_le();
5874 let tmp = buf.get_u16_le();
5875 __struct.estimator_status = EstimatorStatusFlags::from_bits(
5876 tmp & EstimatorStatusFlags::all().bits(),
5877 )
5878 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
5879 flag_type: "EstimatorStatusFlags",
5880 value: tmp as u32,
5881 })?;
5882 __struct.target_system = buf.get_u8();
5883 __struct.target_component = buf.get_u8();
5884 let tmp = buf.get_u8();
5885 __struct.landed_state =
5886 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
5887 enum_type: "MavLandedState",
5888 value: tmp as u32,
5889 })?;
5890 __struct.angular_velocity_z = buf.get_f32_le();
5891 Ok(__struct)
5892 }
5893 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
5894 let mut __tmp = BytesMut::new(bytes);
5895 #[allow(clippy::absurd_extreme_comparisons)]
5896 #[allow(unused_comparisons)]
5897 if __tmp.remaining() < Self::ENCODED_LEN {
5898 panic!(
5899 "buffer is too small (need {} bytes, but got {})",
5900 Self::ENCODED_LEN,
5901 __tmp.remaining(),
5902 )
5903 }
5904 __tmp.put_u64_le(self.time_boot_us);
5905 for val in &self.q {
5906 __tmp.put_f32_le(*val);
5907 }
5908 __tmp.put_u32_le(self.q_estimated_delay_us);
5909 __tmp.put_f32_le(self.vx);
5910 __tmp.put_f32_le(self.vy);
5911 __tmp.put_f32_le(self.vz);
5912 __tmp.put_u32_le(self.v_estimated_delay_us);
5913 __tmp.put_f32_le(self.feed_forward_angular_velocity_z);
5914 __tmp.put_u16_le(self.estimator_status.bits());
5915 __tmp.put_u8(self.target_system);
5916 __tmp.put_u8(self.target_component);
5917 __tmp.put_u8(self.landed_state as u8);
5918 if matches!(version, MavlinkVersion::V2) {
5919 __tmp.put_f32_le(self.angular_velocity_z);
5920 let len = __tmp.len();
5921 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
5922 } else {
5923 __tmp.len()
5924 }
5925 }
5926}
5927#[doc = "Version and capability of autopilot software. This should be emitted in response to a request with MAV_CMD_REQUEST_MESSAGE."]
5928#[doc = ""]
5929#[doc = "ID: 148"]
5930#[derive(Debug, Clone, PartialEq)]
5931#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
5932#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
5933pub struct AUTOPILOT_VERSION_DATA {
5934 #[doc = "Bitmap of capabilities"]
5935 pub capabilities: MavProtocolCapability,
5936 #[doc = "UID if provided by hardware (see uid2)"]
5937 pub uid: u64,
5938 #[doc = "Firmware version number. The field must be encoded as 4 bytes, where each byte (shown from MSB to LSB) is part of a semantic version: (major) (minor) (patch) (FIRMWARE_VERSION_TYPE)."]
5939 pub flight_sw_version: u32,
5940 #[doc = "Middleware version number"]
5941 pub middleware_sw_version: u32,
5942 #[doc = "Operating system version number"]
5943 pub os_sw_version: u32,
5944 #[doc = "HW / board version (last 8 bits should be silicon ID, if any). The first 16 bits of this field specify <https://github.com/PX4/PX4-Bootloader/blob/master/board_types.txt>"]
5945 pub board_version: u32,
5946 #[doc = "ID of the board vendor"]
5947 pub vendor_id: u16,
5948 #[doc = "ID of the product"]
5949 pub product_id: u16,
5950 #[doc = "Custom version field, commonly the first 8 bytes of the git hash. This is not an unique identifier, but should allow to identify the commit using the main version number even for very large code bases."]
5951 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
5952 pub flight_custom_version: [u8; 8],
5953 #[doc = "Custom version field, commonly the first 8 bytes of the git hash. This is not an unique identifier, but should allow to identify the commit using the main version number even for very large code bases."]
5954 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
5955 pub middleware_custom_version: [u8; 8],
5956 #[doc = "Custom version field, commonly the first 8 bytes of the git hash. This is not an unique identifier, but should allow to identify the commit using the main version number even for very large code bases."]
5957 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
5958 pub os_custom_version: [u8; 8],
5959 #[doc = "UID if provided by hardware (supersedes the uid field. If this is non-zero, use this field, otherwise use uid)"]
5960 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
5961 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
5962 pub uid2: [u8; 18],
5963}
5964impl AUTOPILOT_VERSION_DATA {
5965 pub const ENCODED_LEN: usize = 78usize;
5966 pub const DEFAULT: Self = Self {
5967 capabilities: MavProtocolCapability::DEFAULT,
5968 uid: 0_u64,
5969 flight_sw_version: 0_u32,
5970 middleware_sw_version: 0_u32,
5971 os_sw_version: 0_u32,
5972 board_version: 0_u32,
5973 vendor_id: 0_u16,
5974 product_id: 0_u16,
5975 flight_custom_version: [0_u8; 8usize],
5976 middleware_custom_version: [0_u8; 8usize],
5977 os_custom_version: [0_u8; 8usize],
5978 uid2: [0_u8; 18usize],
5979 };
5980 #[cfg(feature = "arbitrary")]
5981 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
5982 use arbitrary::{Arbitrary, Unstructured};
5983 let mut buf = [0u8; 1024];
5984 rng.fill_bytes(&mut buf);
5985 let mut unstructured = Unstructured::new(&buf);
5986 Self::arbitrary(&mut unstructured).unwrap_or_default()
5987 }
5988}
5989impl Default for AUTOPILOT_VERSION_DATA {
5990 fn default() -> Self {
5991 Self::DEFAULT.clone()
5992 }
5993}
5994impl MessageData for AUTOPILOT_VERSION_DATA {
5995 type Message = MavMessage;
5996 const ID: u32 = 148u32;
5997 const NAME: &'static str = "AUTOPILOT_VERSION";
5998 const EXTRA_CRC: u8 = 178u8;
5999 const ENCODED_LEN: usize = 78usize;
6000 fn deser(
6001 _version: MavlinkVersion,
6002 __input: &[u8],
6003 ) -> Result<Self, ::mavlink_core::error::ParserError> {
6004 let avail_len = __input.len();
6005 let mut payload_buf = [0; Self::ENCODED_LEN];
6006 let mut buf = if avail_len < Self::ENCODED_LEN {
6007 payload_buf[0..avail_len].copy_from_slice(__input);
6008 Bytes::new(&payload_buf)
6009 } else {
6010 Bytes::new(__input)
6011 };
6012 let mut __struct = Self::default();
6013 let tmp = buf.get_u64_le();
6014 __struct.capabilities = MavProtocolCapability::from_bits(
6015 tmp & MavProtocolCapability::all().bits(),
6016 )
6017 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
6018 flag_type: "MavProtocolCapability",
6019 value: tmp as u32,
6020 })?;
6021 __struct.uid = buf.get_u64_le();
6022 __struct.flight_sw_version = buf.get_u32_le();
6023 __struct.middleware_sw_version = buf.get_u32_le();
6024 __struct.os_sw_version = buf.get_u32_le();
6025 __struct.board_version = buf.get_u32_le();
6026 __struct.vendor_id = buf.get_u16_le();
6027 __struct.product_id = buf.get_u16_le();
6028 for v in &mut __struct.flight_custom_version {
6029 let val = buf.get_u8();
6030 *v = val;
6031 }
6032 for v in &mut __struct.middleware_custom_version {
6033 let val = buf.get_u8();
6034 *v = val;
6035 }
6036 for v in &mut __struct.os_custom_version {
6037 let val = buf.get_u8();
6038 *v = val;
6039 }
6040 for v in &mut __struct.uid2 {
6041 let val = buf.get_u8();
6042 *v = val;
6043 }
6044 Ok(__struct)
6045 }
6046 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
6047 let mut __tmp = BytesMut::new(bytes);
6048 #[allow(clippy::absurd_extreme_comparisons)]
6049 #[allow(unused_comparisons)]
6050 if __tmp.remaining() < Self::ENCODED_LEN {
6051 panic!(
6052 "buffer is too small (need {} bytes, but got {})",
6053 Self::ENCODED_LEN,
6054 __tmp.remaining(),
6055 )
6056 }
6057 __tmp.put_u64_le(self.capabilities.bits());
6058 __tmp.put_u64_le(self.uid);
6059 __tmp.put_u32_le(self.flight_sw_version);
6060 __tmp.put_u32_le(self.middleware_sw_version);
6061 __tmp.put_u32_le(self.os_sw_version);
6062 __tmp.put_u32_le(self.board_version);
6063 __tmp.put_u16_le(self.vendor_id);
6064 __tmp.put_u16_le(self.product_id);
6065 for val in &self.flight_custom_version {
6066 __tmp.put_u8(*val);
6067 }
6068 for val in &self.middleware_custom_version {
6069 __tmp.put_u8(*val);
6070 }
6071 for val in &self.os_custom_version {
6072 __tmp.put_u8(*val);
6073 }
6074 if matches!(version, MavlinkVersion::V2) {
6075 for val in &self.uid2 {
6076 __tmp.put_u8(*val);
6077 }
6078 let len = __tmp.len();
6079 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
6080 } else {
6081 __tmp.len()
6082 }
6083 }
6084}
6085#[doc = "Information about a flight mode. The message can be enumerated to get information for all modes, or requested for a particular mode, using MAV_CMD_REQUEST_MESSAGE. Specify 0 in param2 to request that the message is emitted for all available modes or the specific index for just one mode. The modes must be available/settable for the current vehicle/frame type. Each mode should only be emitted once (even if it is both standard and custom). Note that the current mode should be emitted in CURRENT_MODE, and that if the mode list can change then AVAILABLE_MODES_MONITOR must be emitted on first change and subsequently streamed. See <https://mavlink.io/en/services/standard_modes.html>."]
6086#[doc = ""]
6087#[doc = "ID: 435"]
6088#[derive(Debug, Clone, PartialEq)]
6089#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
6090#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
6091pub struct AVAILABLE_MODES_DATA {
6092 #[doc = "A bitfield for use for autopilot-specific flags"]
6093 pub custom_mode: u32,
6094 #[doc = "Mode properties."]
6095 pub properties: MavModeProperty,
6096 #[doc = "The total number of available modes for the current vehicle type."]
6097 pub number_modes: u8,
6098 #[doc = "The current mode index within number_modes, indexed from 1. The index is not guaranteed to be persistent, and may change between reboots or if the set of modes change."]
6099 pub mode_index: u8,
6100 #[doc = "Standard mode."]
6101 pub standard_mode: MavStandardMode,
6102 #[doc = "Name of custom mode, with null termination character. Should be omitted for standard modes."]
6103 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
6104 pub mode_name: [u8; 35],
6105}
6106impl AVAILABLE_MODES_DATA {
6107 pub const ENCODED_LEN: usize = 46usize;
6108 pub const DEFAULT: Self = Self {
6109 custom_mode: 0_u32,
6110 properties: MavModeProperty::DEFAULT,
6111 number_modes: 0_u8,
6112 mode_index: 0_u8,
6113 standard_mode: MavStandardMode::DEFAULT,
6114 mode_name: [0_u8; 35usize],
6115 };
6116 #[cfg(feature = "arbitrary")]
6117 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
6118 use arbitrary::{Arbitrary, Unstructured};
6119 let mut buf = [0u8; 1024];
6120 rng.fill_bytes(&mut buf);
6121 let mut unstructured = Unstructured::new(&buf);
6122 Self::arbitrary(&mut unstructured).unwrap_or_default()
6123 }
6124}
6125impl Default for AVAILABLE_MODES_DATA {
6126 fn default() -> Self {
6127 Self::DEFAULT.clone()
6128 }
6129}
6130impl MessageData for AVAILABLE_MODES_DATA {
6131 type Message = MavMessage;
6132 const ID: u32 = 435u32;
6133 const NAME: &'static str = "AVAILABLE_MODES";
6134 const EXTRA_CRC: u8 = 134u8;
6135 const ENCODED_LEN: usize = 46usize;
6136 fn deser(
6137 _version: MavlinkVersion,
6138 __input: &[u8],
6139 ) -> Result<Self, ::mavlink_core::error::ParserError> {
6140 let avail_len = __input.len();
6141 let mut payload_buf = [0; Self::ENCODED_LEN];
6142 let mut buf = if avail_len < Self::ENCODED_LEN {
6143 payload_buf[0..avail_len].copy_from_slice(__input);
6144 Bytes::new(&payload_buf)
6145 } else {
6146 Bytes::new(__input)
6147 };
6148 let mut __struct = Self::default();
6149 __struct.custom_mode = buf.get_u32_le();
6150 let tmp = buf.get_u32_le();
6151 __struct.properties = MavModeProperty::from_bits(tmp & MavModeProperty::all().bits())
6152 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
6153 flag_type: "MavModeProperty",
6154 value: tmp as u32,
6155 })?;
6156 __struct.number_modes = buf.get_u8();
6157 __struct.mode_index = buf.get_u8();
6158 let tmp = buf.get_u8();
6159 __struct.standard_mode =
6160 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
6161 enum_type: "MavStandardMode",
6162 value: tmp as u32,
6163 })?;
6164 for v in &mut __struct.mode_name {
6165 let val = buf.get_u8();
6166 *v = val;
6167 }
6168 Ok(__struct)
6169 }
6170 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
6171 let mut __tmp = BytesMut::new(bytes);
6172 #[allow(clippy::absurd_extreme_comparisons)]
6173 #[allow(unused_comparisons)]
6174 if __tmp.remaining() < Self::ENCODED_LEN {
6175 panic!(
6176 "buffer is too small (need {} bytes, but got {})",
6177 Self::ENCODED_LEN,
6178 __tmp.remaining(),
6179 )
6180 }
6181 __tmp.put_u32_le(self.custom_mode);
6182 __tmp.put_u32_le(self.properties.bits());
6183 __tmp.put_u8(self.number_modes);
6184 __tmp.put_u8(self.mode_index);
6185 __tmp.put_u8(self.standard_mode as u8);
6186 for val in &self.mode_name {
6187 __tmp.put_u8(*val);
6188 }
6189 if matches!(version, MavlinkVersion::V2) {
6190 let len = __tmp.len();
6191 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
6192 } else {
6193 __tmp.len()
6194 }
6195 }
6196}
6197#[doc = "A change to the sequence number indicates that the set of AVAILABLE_MODES has changed. A receiver must re-request all available modes whenever the sequence number changes. This is only emitted after the first change and should then be broadcast at low rate (nominally 0.3 Hz) and on change. See <https://mavlink.io/en/services/standard_modes.html>."]
6198#[doc = ""]
6199#[doc = "ID: 437"]
6200#[derive(Debug, Clone, PartialEq)]
6201#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
6202#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
6203pub struct AVAILABLE_MODES_MONITOR_DATA {
6204 #[doc = "Sequence number. The value iterates sequentially whenever AVAILABLE_MODES changes (e.g. support for a new mode is added/removed dynamically)."]
6205 pub seq: u8,
6206}
6207impl AVAILABLE_MODES_MONITOR_DATA {
6208 pub const ENCODED_LEN: usize = 1usize;
6209 pub const DEFAULT: Self = Self { seq: 0_u8 };
6210 #[cfg(feature = "arbitrary")]
6211 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
6212 use arbitrary::{Arbitrary, Unstructured};
6213 let mut buf = [0u8; 1024];
6214 rng.fill_bytes(&mut buf);
6215 let mut unstructured = Unstructured::new(&buf);
6216 Self::arbitrary(&mut unstructured).unwrap_or_default()
6217 }
6218}
6219impl Default for AVAILABLE_MODES_MONITOR_DATA {
6220 fn default() -> Self {
6221 Self::DEFAULT.clone()
6222 }
6223}
6224impl MessageData for AVAILABLE_MODES_MONITOR_DATA {
6225 type Message = MavMessage;
6226 const ID: u32 = 437u32;
6227 const NAME: &'static str = "AVAILABLE_MODES_MONITOR";
6228 const EXTRA_CRC: u8 = 30u8;
6229 const ENCODED_LEN: usize = 1usize;
6230 fn deser(
6231 _version: MavlinkVersion,
6232 __input: &[u8],
6233 ) -> Result<Self, ::mavlink_core::error::ParserError> {
6234 let avail_len = __input.len();
6235 let mut payload_buf = [0; Self::ENCODED_LEN];
6236 let mut buf = if avail_len < Self::ENCODED_LEN {
6237 payload_buf[0..avail_len].copy_from_slice(__input);
6238 Bytes::new(&payload_buf)
6239 } else {
6240 Bytes::new(__input)
6241 };
6242 let mut __struct = Self::default();
6243 __struct.seq = buf.get_u8();
6244 Ok(__struct)
6245 }
6246 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
6247 let mut __tmp = BytesMut::new(bytes);
6248 #[allow(clippy::absurd_extreme_comparisons)]
6249 #[allow(unused_comparisons)]
6250 if __tmp.remaining() < Self::ENCODED_LEN {
6251 panic!(
6252 "buffer is too small (need {} bytes, but got {})",
6253 Self::ENCODED_LEN,
6254 __tmp.remaining(),
6255 )
6256 }
6257 __tmp.put_u8(self.seq);
6258 if matches!(version, MavlinkVersion::V2) {
6259 let len = __tmp.len();
6260 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
6261 } else {
6262 __tmp.len()
6263 }
6264 }
6265}
6266#[doc = "Drone IMU data. Quaternion order is w, x, y, z and a zero rotation would be expressed as (1 0 0 0)."]
6267#[doc = ""]
6268#[doc = "ID: 60052"]
6269#[derive(Debug, Clone, PartialEq)]
6270#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
6271#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
6272pub struct AVSS_DRONE_IMU_DATA {
6273 #[doc = "Timestamp (time since FC boot)."]
6274 pub time_boot_ms: u32,
6275 #[doc = "Quaternion component 1, w (1 in null-rotation)"]
6276 pub q1: f32,
6277 #[doc = "Quaternion component 2, x (0 in null-rotation)"]
6278 pub q2: f32,
6279 #[doc = "Quaternion component 3, y (0 in null-rotation)"]
6280 pub q3: f32,
6281 #[doc = "Quaternion component 4, z (0 in null-rotation)"]
6282 pub q4: f32,
6283 #[doc = "X acceleration"]
6284 pub xacc: f32,
6285 #[doc = "Y acceleration"]
6286 pub yacc: f32,
6287 #[doc = "Z acceleration"]
6288 pub zacc: f32,
6289 #[doc = "Angular speed around X axis"]
6290 pub xgyro: f32,
6291 #[doc = "Angular speed around Y axis"]
6292 pub ygyro: f32,
6293 #[doc = "Angular speed around Z axis"]
6294 pub zgyro: f32,
6295}
6296impl AVSS_DRONE_IMU_DATA {
6297 pub const ENCODED_LEN: usize = 44usize;
6298 pub const DEFAULT: Self = Self {
6299 time_boot_ms: 0_u32,
6300 q1: 0.0_f32,
6301 q2: 0.0_f32,
6302 q3: 0.0_f32,
6303 q4: 0.0_f32,
6304 xacc: 0.0_f32,
6305 yacc: 0.0_f32,
6306 zacc: 0.0_f32,
6307 xgyro: 0.0_f32,
6308 ygyro: 0.0_f32,
6309 zgyro: 0.0_f32,
6310 };
6311 #[cfg(feature = "arbitrary")]
6312 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
6313 use arbitrary::{Arbitrary, Unstructured};
6314 let mut buf = [0u8; 1024];
6315 rng.fill_bytes(&mut buf);
6316 let mut unstructured = Unstructured::new(&buf);
6317 Self::arbitrary(&mut unstructured).unwrap_or_default()
6318 }
6319}
6320impl Default for AVSS_DRONE_IMU_DATA {
6321 fn default() -> Self {
6322 Self::DEFAULT.clone()
6323 }
6324}
6325impl MessageData for AVSS_DRONE_IMU_DATA {
6326 type Message = MavMessage;
6327 const ID: u32 = 60052u32;
6328 const NAME: &'static str = "AVSS_DRONE_IMU";
6329 const EXTRA_CRC: u8 = 101u8;
6330 const ENCODED_LEN: usize = 44usize;
6331 fn deser(
6332 _version: MavlinkVersion,
6333 __input: &[u8],
6334 ) -> Result<Self, ::mavlink_core::error::ParserError> {
6335 let avail_len = __input.len();
6336 let mut payload_buf = [0; Self::ENCODED_LEN];
6337 let mut buf = if avail_len < Self::ENCODED_LEN {
6338 payload_buf[0..avail_len].copy_from_slice(__input);
6339 Bytes::new(&payload_buf)
6340 } else {
6341 Bytes::new(__input)
6342 };
6343 let mut __struct = Self::default();
6344 __struct.time_boot_ms = buf.get_u32_le();
6345 __struct.q1 = buf.get_f32_le();
6346 __struct.q2 = buf.get_f32_le();
6347 __struct.q3 = buf.get_f32_le();
6348 __struct.q4 = buf.get_f32_le();
6349 __struct.xacc = buf.get_f32_le();
6350 __struct.yacc = buf.get_f32_le();
6351 __struct.zacc = buf.get_f32_le();
6352 __struct.xgyro = buf.get_f32_le();
6353 __struct.ygyro = buf.get_f32_le();
6354 __struct.zgyro = buf.get_f32_le();
6355 Ok(__struct)
6356 }
6357 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
6358 let mut __tmp = BytesMut::new(bytes);
6359 #[allow(clippy::absurd_extreme_comparisons)]
6360 #[allow(unused_comparisons)]
6361 if __tmp.remaining() < Self::ENCODED_LEN {
6362 panic!(
6363 "buffer is too small (need {} bytes, but got {})",
6364 Self::ENCODED_LEN,
6365 __tmp.remaining(),
6366 )
6367 }
6368 __tmp.put_u32_le(self.time_boot_ms);
6369 __tmp.put_f32_le(self.q1);
6370 __tmp.put_f32_le(self.q2);
6371 __tmp.put_f32_le(self.q3);
6372 __tmp.put_f32_le(self.q4);
6373 __tmp.put_f32_le(self.xacc);
6374 __tmp.put_f32_le(self.yacc);
6375 __tmp.put_f32_le(self.zacc);
6376 __tmp.put_f32_le(self.xgyro);
6377 __tmp.put_f32_le(self.ygyro);
6378 __tmp.put_f32_le(self.zgyro);
6379 if matches!(version, MavlinkVersion::V2) {
6380 let len = __tmp.len();
6381 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
6382 } else {
6383 __tmp.len()
6384 }
6385 }
6386}
6387#[doc = "Drone operation mode."]
6388#[doc = ""]
6389#[doc = "ID: 60053"]
6390#[derive(Debug, Clone, PartialEq)]
6391#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
6392#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
6393pub struct AVSS_DRONE_OPERATION_MODE_DATA {
6394 #[doc = "Timestamp (time since FC boot)."]
6395 pub time_boot_ms: u32,
6396 #[doc = "DJI M300 operation mode"]
6397 pub M300_operation_mode: u8,
6398 #[doc = "horsefly operation mode"]
6399 pub horsefly_operation_mode: u8,
6400}
6401impl AVSS_DRONE_OPERATION_MODE_DATA {
6402 pub const ENCODED_LEN: usize = 6usize;
6403 pub const DEFAULT: Self = Self {
6404 time_boot_ms: 0_u32,
6405 M300_operation_mode: 0_u8,
6406 horsefly_operation_mode: 0_u8,
6407 };
6408 #[cfg(feature = "arbitrary")]
6409 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
6410 use arbitrary::{Arbitrary, Unstructured};
6411 let mut buf = [0u8; 1024];
6412 rng.fill_bytes(&mut buf);
6413 let mut unstructured = Unstructured::new(&buf);
6414 Self::arbitrary(&mut unstructured).unwrap_or_default()
6415 }
6416}
6417impl Default for AVSS_DRONE_OPERATION_MODE_DATA {
6418 fn default() -> Self {
6419 Self::DEFAULT.clone()
6420 }
6421}
6422impl MessageData for AVSS_DRONE_OPERATION_MODE_DATA {
6423 type Message = MavMessage;
6424 const ID: u32 = 60053u32;
6425 const NAME: &'static str = "AVSS_DRONE_OPERATION_MODE";
6426 const EXTRA_CRC: u8 = 45u8;
6427 const ENCODED_LEN: usize = 6usize;
6428 fn deser(
6429 _version: MavlinkVersion,
6430 __input: &[u8],
6431 ) -> Result<Self, ::mavlink_core::error::ParserError> {
6432 let avail_len = __input.len();
6433 let mut payload_buf = [0; Self::ENCODED_LEN];
6434 let mut buf = if avail_len < Self::ENCODED_LEN {
6435 payload_buf[0..avail_len].copy_from_slice(__input);
6436 Bytes::new(&payload_buf)
6437 } else {
6438 Bytes::new(__input)
6439 };
6440 let mut __struct = Self::default();
6441 __struct.time_boot_ms = buf.get_u32_le();
6442 __struct.M300_operation_mode = buf.get_u8();
6443 __struct.horsefly_operation_mode = buf.get_u8();
6444 Ok(__struct)
6445 }
6446 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
6447 let mut __tmp = BytesMut::new(bytes);
6448 #[allow(clippy::absurd_extreme_comparisons)]
6449 #[allow(unused_comparisons)]
6450 if __tmp.remaining() < Self::ENCODED_LEN {
6451 panic!(
6452 "buffer is too small (need {} bytes, but got {})",
6453 Self::ENCODED_LEN,
6454 __tmp.remaining(),
6455 )
6456 }
6457 __tmp.put_u32_le(self.time_boot_ms);
6458 __tmp.put_u8(self.M300_operation_mode);
6459 __tmp.put_u8(self.horsefly_operation_mode);
6460 if matches!(version, MavlinkVersion::V2) {
6461 let len = __tmp.len();
6462 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
6463 } else {
6464 __tmp.len()
6465 }
6466 }
6467}
6468#[doc = "Drone position."]
6469#[doc = ""]
6470#[doc = "ID: 60051"]
6471#[derive(Debug, Clone, PartialEq)]
6472#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
6473#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
6474pub struct AVSS_DRONE_POSITION_DATA {
6475 #[doc = "Timestamp (time since FC boot)."]
6476 pub time_boot_ms: u32,
6477 #[doc = "Latitude, expressed"]
6478 pub lat: i32,
6479 #[doc = "Longitude, expressed"]
6480 pub lon: i32,
6481 #[doc = "Altitude (MSL). Note that virtually all GPS modules provide both WGS84 and MSL."]
6482 pub alt: i32,
6483 #[doc = "Altitude above ground, This altitude is measured by a ultrasound, Laser rangefinder or millimeter-wave radar"]
6484 pub ground_alt: f32,
6485 #[doc = "This altitude is measured by a barometer"]
6486 pub barometer_alt: f32,
6487}
6488impl AVSS_DRONE_POSITION_DATA {
6489 pub const ENCODED_LEN: usize = 24usize;
6490 pub const DEFAULT: Self = Self {
6491 time_boot_ms: 0_u32,
6492 lat: 0_i32,
6493 lon: 0_i32,
6494 alt: 0_i32,
6495 ground_alt: 0.0_f32,
6496 barometer_alt: 0.0_f32,
6497 };
6498 #[cfg(feature = "arbitrary")]
6499 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
6500 use arbitrary::{Arbitrary, Unstructured};
6501 let mut buf = [0u8; 1024];
6502 rng.fill_bytes(&mut buf);
6503 let mut unstructured = Unstructured::new(&buf);
6504 Self::arbitrary(&mut unstructured).unwrap_or_default()
6505 }
6506}
6507impl Default for AVSS_DRONE_POSITION_DATA {
6508 fn default() -> Self {
6509 Self::DEFAULT.clone()
6510 }
6511}
6512impl MessageData for AVSS_DRONE_POSITION_DATA {
6513 type Message = MavMessage;
6514 const ID: u32 = 60051u32;
6515 const NAME: &'static str = "AVSS_DRONE_POSITION";
6516 const EXTRA_CRC: u8 = 245u8;
6517 const ENCODED_LEN: usize = 24usize;
6518 fn deser(
6519 _version: MavlinkVersion,
6520 __input: &[u8],
6521 ) -> Result<Self, ::mavlink_core::error::ParserError> {
6522 let avail_len = __input.len();
6523 let mut payload_buf = [0; Self::ENCODED_LEN];
6524 let mut buf = if avail_len < Self::ENCODED_LEN {
6525 payload_buf[0..avail_len].copy_from_slice(__input);
6526 Bytes::new(&payload_buf)
6527 } else {
6528 Bytes::new(__input)
6529 };
6530 let mut __struct = Self::default();
6531 __struct.time_boot_ms = buf.get_u32_le();
6532 __struct.lat = buf.get_i32_le();
6533 __struct.lon = buf.get_i32_le();
6534 __struct.alt = buf.get_i32_le();
6535 __struct.ground_alt = buf.get_f32_le();
6536 __struct.barometer_alt = buf.get_f32_le();
6537 Ok(__struct)
6538 }
6539 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
6540 let mut __tmp = BytesMut::new(bytes);
6541 #[allow(clippy::absurd_extreme_comparisons)]
6542 #[allow(unused_comparisons)]
6543 if __tmp.remaining() < Self::ENCODED_LEN {
6544 panic!(
6545 "buffer is too small (need {} bytes, but got {})",
6546 Self::ENCODED_LEN,
6547 __tmp.remaining(),
6548 )
6549 }
6550 __tmp.put_u32_le(self.time_boot_ms);
6551 __tmp.put_i32_le(self.lat);
6552 __tmp.put_i32_le(self.lon);
6553 __tmp.put_i32_le(self.alt);
6554 __tmp.put_f32_le(self.ground_alt);
6555 __tmp.put_f32_le(self.barometer_alt);
6556 if matches!(version, MavlinkVersion::V2) {
6557 let len = __tmp.len();
6558 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
6559 } else {
6560 __tmp.len()
6561 }
6562 }
6563}
6564#[doc = "AVSS PRS system status."]
6565#[doc = ""]
6566#[doc = "ID: 60050"]
6567#[derive(Debug, Clone, PartialEq)]
6568#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
6569#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
6570pub struct AVSS_PRS_SYS_STATUS_DATA {
6571 #[doc = "Timestamp (time since PRS boot)."]
6572 pub time_boot_ms: u32,
6573 #[doc = "PRS error statuses"]
6574 pub error_status: u32,
6575 #[doc = "Estimated battery run-time without a remote connection and PRS battery voltage"]
6576 pub battery_status: u32,
6577 #[doc = "PRS arm statuses"]
6578 pub arm_status: u8,
6579 #[doc = "PRS battery charge statuses"]
6580 pub charge_status: u8,
6581}
6582impl AVSS_PRS_SYS_STATUS_DATA {
6583 pub const ENCODED_LEN: usize = 14usize;
6584 pub const DEFAULT: Self = Self {
6585 time_boot_ms: 0_u32,
6586 error_status: 0_u32,
6587 battery_status: 0_u32,
6588 arm_status: 0_u8,
6589 charge_status: 0_u8,
6590 };
6591 #[cfg(feature = "arbitrary")]
6592 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
6593 use arbitrary::{Arbitrary, Unstructured};
6594 let mut buf = [0u8; 1024];
6595 rng.fill_bytes(&mut buf);
6596 let mut unstructured = Unstructured::new(&buf);
6597 Self::arbitrary(&mut unstructured).unwrap_or_default()
6598 }
6599}
6600impl Default for AVSS_PRS_SYS_STATUS_DATA {
6601 fn default() -> Self {
6602 Self::DEFAULT.clone()
6603 }
6604}
6605impl MessageData for AVSS_PRS_SYS_STATUS_DATA {
6606 type Message = MavMessage;
6607 const ID: u32 = 60050u32;
6608 const NAME: &'static str = "AVSS_PRS_SYS_STATUS";
6609 const EXTRA_CRC: u8 = 220u8;
6610 const ENCODED_LEN: usize = 14usize;
6611 fn deser(
6612 _version: MavlinkVersion,
6613 __input: &[u8],
6614 ) -> Result<Self, ::mavlink_core::error::ParserError> {
6615 let avail_len = __input.len();
6616 let mut payload_buf = [0; Self::ENCODED_LEN];
6617 let mut buf = if avail_len < Self::ENCODED_LEN {
6618 payload_buf[0..avail_len].copy_from_slice(__input);
6619 Bytes::new(&payload_buf)
6620 } else {
6621 Bytes::new(__input)
6622 };
6623 let mut __struct = Self::default();
6624 __struct.time_boot_ms = buf.get_u32_le();
6625 __struct.error_status = buf.get_u32_le();
6626 __struct.battery_status = buf.get_u32_le();
6627 __struct.arm_status = buf.get_u8();
6628 __struct.charge_status = buf.get_u8();
6629 Ok(__struct)
6630 }
6631 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
6632 let mut __tmp = BytesMut::new(bytes);
6633 #[allow(clippy::absurd_extreme_comparisons)]
6634 #[allow(unused_comparisons)]
6635 if __tmp.remaining() < Self::ENCODED_LEN {
6636 panic!(
6637 "buffer is too small (need {} bytes, but got {})",
6638 Self::ENCODED_LEN,
6639 __tmp.remaining(),
6640 )
6641 }
6642 __tmp.put_u32_le(self.time_boot_ms);
6643 __tmp.put_u32_le(self.error_status);
6644 __tmp.put_u32_le(self.battery_status);
6645 __tmp.put_u8(self.arm_status);
6646 __tmp.put_u8(self.charge_status);
6647 if matches!(version, MavlinkVersion::V2) {
6648 let len = __tmp.len();
6649 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
6650 } else {
6651 __tmp.len()
6652 }
6653 }
6654}
6655#[doc = "Battery information that is static, or requires infrequent update. This message should requested using MAV_CMD_REQUEST_MESSAGE and/or streamed at very low rate. BATTERY_STATUS_V2 is used for higher-rate battery status information."]
6656#[doc = ""]
6657#[doc = "ID: 372"]
6658#[derive(Debug, Clone, PartialEq)]
6659#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
6660#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
6661pub struct BATTERY_INFO_DATA {
6662 #[doc = "Minimum per-cell voltage when discharging. 0: field not provided."]
6663 pub discharge_minimum_voltage: f32,
6664 #[doc = "Minimum per-cell voltage when charging. 0: field not provided."]
6665 pub charging_minimum_voltage: f32,
6666 #[doc = "Minimum per-cell voltage when resting. 0: field not provided."]
6667 pub resting_minimum_voltage: f32,
6668 #[doc = "Maximum per-cell voltage when charged. 0: field not provided."]
6669 pub charging_maximum_voltage: f32,
6670 #[doc = "Maximum pack continuous charge current. 0: field not provided."]
6671 pub charging_maximum_current: f32,
6672 #[doc = "Battery nominal voltage. Used for conversion between Wh and Ah. 0: field not provided."]
6673 pub nominal_voltage: f32,
6674 #[doc = "Maximum pack discharge current. 0: field not provided."]
6675 pub discharge_maximum_current: f32,
6676 #[doc = "Maximum pack discharge burst current. 0: field not provided."]
6677 pub discharge_maximum_burst_current: f32,
6678 #[doc = "Fully charged design capacity. 0: field not provided."]
6679 pub design_capacity: f32,
6680 #[doc = "Predicted battery capacity when fully charged (accounting for battery degradation). NAN: field not provided."]
6681 pub full_charge_capacity: f32,
6682 #[doc = "Lifetime count of the number of charge/discharge cycles (<https://en.wikipedia.org/wiki/Charge_cycle>). UINT16_MAX: field not provided."]
6683 pub cycle_count: u16,
6684 #[doc = "Battery weight. 0: field not provided."]
6685 pub weight: u16,
6686 #[doc = "Battery ID"]
6687 pub id: u8,
6688 #[doc = "Function of the battery."]
6689 pub battery_function: MavBatteryFunction,
6690 #[doc = "Type (chemistry) of the battery."]
6691 pub mavtype: MavBatteryType,
6692 #[doc = "State of Health (SOH) estimate. Typically 100% at the time of manufacture and will decrease over time and use. -1: field not provided."]
6693 pub state_of_health: u8,
6694 #[doc = "Number of battery cells in series. 0: field not provided."]
6695 pub cells_in_series: u8,
6696 #[doc = "Manufacture date (DDMMYYYY) in ASCII characters, 0 terminated. All 0: field not provided."]
6697 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
6698 pub manufacture_date: [u8; 9],
6699 #[doc = "Serial number in ASCII characters, 0 terminated. All 0: field not provided."]
6700 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
6701 pub serial_number: [u8; 32],
6702 #[doc = "Battery device name. Formatted as manufacturer name then product name, separated with an underscore (in ASCII characters), 0 terminated. All 0: field not provided."]
6703 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
6704 pub name: [u8; 50],
6705}
6706impl BATTERY_INFO_DATA {
6707 pub const ENCODED_LEN: usize = 140usize;
6708 pub const DEFAULT: Self = Self {
6709 discharge_minimum_voltage: 0.0_f32,
6710 charging_minimum_voltage: 0.0_f32,
6711 resting_minimum_voltage: 0.0_f32,
6712 charging_maximum_voltage: 0.0_f32,
6713 charging_maximum_current: 0.0_f32,
6714 nominal_voltage: 0.0_f32,
6715 discharge_maximum_current: 0.0_f32,
6716 discharge_maximum_burst_current: 0.0_f32,
6717 design_capacity: 0.0_f32,
6718 full_charge_capacity: 0.0_f32,
6719 cycle_count: 0_u16,
6720 weight: 0_u16,
6721 id: 0_u8,
6722 battery_function: MavBatteryFunction::DEFAULT,
6723 mavtype: MavBatteryType::DEFAULT,
6724 state_of_health: 0_u8,
6725 cells_in_series: 0_u8,
6726 manufacture_date: [0_u8; 9usize],
6727 serial_number: [0_u8; 32usize],
6728 name: [0_u8; 50usize],
6729 };
6730 #[cfg(feature = "arbitrary")]
6731 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
6732 use arbitrary::{Arbitrary, Unstructured};
6733 let mut buf = [0u8; 1024];
6734 rng.fill_bytes(&mut buf);
6735 let mut unstructured = Unstructured::new(&buf);
6736 Self::arbitrary(&mut unstructured).unwrap_or_default()
6737 }
6738}
6739impl Default for BATTERY_INFO_DATA {
6740 fn default() -> Self {
6741 Self::DEFAULT.clone()
6742 }
6743}
6744impl MessageData for BATTERY_INFO_DATA {
6745 type Message = MavMessage;
6746 const ID: u32 = 372u32;
6747 const NAME: &'static str = "BATTERY_INFO";
6748 const EXTRA_CRC: u8 = 26u8;
6749 const ENCODED_LEN: usize = 140usize;
6750 fn deser(
6751 _version: MavlinkVersion,
6752 __input: &[u8],
6753 ) -> Result<Self, ::mavlink_core::error::ParserError> {
6754 let avail_len = __input.len();
6755 let mut payload_buf = [0; Self::ENCODED_LEN];
6756 let mut buf = if avail_len < Self::ENCODED_LEN {
6757 payload_buf[0..avail_len].copy_from_slice(__input);
6758 Bytes::new(&payload_buf)
6759 } else {
6760 Bytes::new(__input)
6761 };
6762 let mut __struct = Self::default();
6763 __struct.discharge_minimum_voltage = buf.get_f32_le();
6764 __struct.charging_minimum_voltage = buf.get_f32_le();
6765 __struct.resting_minimum_voltage = buf.get_f32_le();
6766 __struct.charging_maximum_voltage = buf.get_f32_le();
6767 __struct.charging_maximum_current = buf.get_f32_le();
6768 __struct.nominal_voltage = buf.get_f32_le();
6769 __struct.discharge_maximum_current = buf.get_f32_le();
6770 __struct.discharge_maximum_burst_current = buf.get_f32_le();
6771 __struct.design_capacity = buf.get_f32_le();
6772 __struct.full_charge_capacity = buf.get_f32_le();
6773 __struct.cycle_count = buf.get_u16_le();
6774 __struct.weight = buf.get_u16_le();
6775 __struct.id = buf.get_u8();
6776 let tmp = buf.get_u8();
6777 __struct.battery_function =
6778 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
6779 enum_type: "MavBatteryFunction",
6780 value: tmp as u32,
6781 })?;
6782 let tmp = buf.get_u8();
6783 __struct.mavtype =
6784 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
6785 enum_type: "MavBatteryType",
6786 value: tmp as u32,
6787 })?;
6788 __struct.state_of_health = buf.get_u8();
6789 __struct.cells_in_series = buf.get_u8();
6790 for v in &mut __struct.manufacture_date {
6791 let val = buf.get_u8();
6792 *v = val;
6793 }
6794 for v in &mut __struct.serial_number {
6795 let val = buf.get_u8();
6796 *v = val;
6797 }
6798 for v in &mut __struct.name {
6799 let val = buf.get_u8();
6800 *v = val;
6801 }
6802 Ok(__struct)
6803 }
6804 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
6805 let mut __tmp = BytesMut::new(bytes);
6806 #[allow(clippy::absurd_extreme_comparisons)]
6807 #[allow(unused_comparisons)]
6808 if __tmp.remaining() < Self::ENCODED_LEN {
6809 panic!(
6810 "buffer is too small (need {} bytes, but got {})",
6811 Self::ENCODED_LEN,
6812 __tmp.remaining(),
6813 )
6814 }
6815 __tmp.put_f32_le(self.discharge_minimum_voltage);
6816 __tmp.put_f32_le(self.charging_minimum_voltage);
6817 __tmp.put_f32_le(self.resting_minimum_voltage);
6818 __tmp.put_f32_le(self.charging_maximum_voltage);
6819 __tmp.put_f32_le(self.charging_maximum_current);
6820 __tmp.put_f32_le(self.nominal_voltage);
6821 __tmp.put_f32_le(self.discharge_maximum_current);
6822 __tmp.put_f32_le(self.discharge_maximum_burst_current);
6823 __tmp.put_f32_le(self.design_capacity);
6824 __tmp.put_f32_le(self.full_charge_capacity);
6825 __tmp.put_u16_le(self.cycle_count);
6826 __tmp.put_u16_le(self.weight);
6827 __tmp.put_u8(self.id);
6828 __tmp.put_u8(self.battery_function as u8);
6829 __tmp.put_u8(self.mavtype as u8);
6830 __tmp.put_u8(self.state_of_health);
6831 __tmp.put_u8(self.cells_in_series);
6832 for val in &self.manufacture_date {
6833 __tmp.put_u8(*val);
6834 }
6835 for val in &self.serial_number {
6836 __tmp.put_u8(*val);
6837 }
6838 for val in &self.name {
6839 __tmp.put_u8(*val);
6840 }
6841 if matches!(version, MavlinkVersion::V2) {
6842 let len = __tmp.len();
6843 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
6844 } else {
6845 __tmp.len()
6846 }
6847 }
6848}
6849#[doc = "Battery information. Updates GCS with flight controller battery status. Smart batteries also use this message, but may additionally send BATTERY_INFO."]
6850#[doc = ""]
6851#[doc = "ID: 147"]
6852#[derive(Debug, Clone, PartialEq)]
6853#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
6854#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
6855pub struct BATTERY_STATUS_DATA {
6856 #[doc = "Consumed charge, -1: autopilot does not provide consumption estimate"]
6857 pub current_consumed: i32,
6858 #[doc = "Consumed energy, -1: autopilot does not provide energy consumption estimate"]
6859 pub energy_consumed: i32,
6860 #[doc = "Temperature of the battery. INT16_MAX for unknown temperature."]
6861 pub temperature: i16,
6862 #[doc = "Battery voltage of cells 1 to 10 (see voltages_ext for cells 11-14). Cells in this field above the valid cell count for this battery should have the UINT16_MAX value. If individual cell voltages are unknown or not measured for this battery, then the overall battery voltage should be filled in cell 0, with all others set to UINT16_MAX. If the voltage of the battery is greater than (UINT16_MAX - 1), then cell 0 should be set to (UINT16_MAX - 1), and cell 1 to the remaining voltage. This can be extended to multiple cells if the total voltage is greater than 2 * (UINT16_MAX - 1)."]
6863 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
6864 pub voltages: [u16; 10],
6865 #[doc = "Battery current, -1: autopilot does not measure the current"]
6866 pub current_battery: i16,
6867 #[doc = "Battery ID"]
6868 pub id: u8,
6869 #[doc = "Function of the battery"]
6870 pub battery_function: MavBatteryFunction,
6871 #[doc = "Type (chemistry) of the battery"]
6872 pub mavtype: MavBatteryType,
6873 #[doc = "Remaining battery energy. Values: [0-100], -1: autopilot does not estimate the remaining battery."]
6874 pub battery_remaining: i8,
6875 #[doc = "Remaining battery time, 0: autopilot does not provide remaining battery time estimate"]
6876 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
6877 pub time_remaining: i32,
6878 #[doc = "State for extent of discharge, provided by autopilot for warning or external reactions"]
6879 #[cfg_attr(feature = "serde", serde(default))]
6880 pub charge_state: MavBatteryChargeState,
6881 #[doc = "Battery voltages for cells 11 to 14. Cells above the valid cell count for this battery should have a value of 0, where zero indicates not supported (note, this is different than for the voltages field and allows empty byte truncation). If the measured value is 0 then 1 should be sent instead."]
6882 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
6883 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
6884 pub voltages_ext: [u16; 4],
6885 #[doc = "Battery mode. Default (0) is that battery mode reporting is not supported or battery is in normal-use mode."]
6886 #[cfg_attr(feature = "serde", serde(default))]
6887 pub mode: MavBatteryMode,
6888 #[doc = "Fault/health indications. These should be set when charge_state is MAV_BATTERY_CHARGE_STATE_FAILED or MAV_BATTERY_CHARGE_STATE_UNHEALTHY (if not, fault reporting is not supported)."]
6889 #[cfg_attr(feature = "serde", serde(default))]
6890 pub fault_bitmask: MavBatteryFault,
6891}
6892impl BATTERY_STATUS_DATA {
6893 pub const ENCODED_LEN: usize = 54usize;
6894 pub const DEFAULT: Self = Self {
6895 current_consumed: 0_i32,
6896 energy_consumed: 0_i32,
6897 temperature: 0_i16,
6898 voltages: [0_u16; 10usize],
6899 current_battery: 0_i16,
6900 id: 0_u8,
6901 battery_function: MavBatteryFunction::DEFAULT,
6902 mavtype: MavBatteryType::DEFAULT,
6903 battery_remaining: 0_i8,
6904 time_remaining: 0_i32,
6905 charge_state: MavBatteryChargeState::DEFAULT,
6906 voltages_ext: [0_u16; 4usize],
6907 mode: MavBatteryMode::DEFAULT,
6908 fault_bitmask: MavBatteryFault::DEFAULT,
6909 };
6910 #[cfg(feature = "arbitrary")]
6911 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
6912 use arbitrary::{Arbitrary, Unstructured};
6913 let mut buf = [0u8; 1024];
6914 rng.fill_bytes(&mut buf);
6915 let mut unstructured = Unstructured::new(&buf);
6916 Self::arbitrary(&mut unstructured).unwrap_or_default()
6917 }
6918}
6919impl Default for BATTERY_STATUS_DATA {
6920 fn default() -> Self {
6921 Self::DEFAULT.clone()
6922 }
6923}
6924impl MessageData for BATTERY_STATUS_DATA {
6925 type Message = MavMessage;
6926 const ID: u32 = 147u32;
6927 const NAME: &'static str = "BATTERY_STATUS";
6928 const EXTRA_CRC: u8 = 154u8;
6929 const ENCODED_LEN: usize = 54usize;
6930 fn deser(
6931 _version: MavlinkVersion,
6932 __input: &[u8],
6933 ) -> Result<Self, ::mavlink_core::error::ParserError> {
6934 let avail_len = __input.len();
6935 let mut payload_buf = [0; Self::ENCODED_LEN];
6936 let mut buf = if avail_len < Self::ENCODED_LEN {
6937 payload_buf[0..avail_len].copy_from_slice(__input);
6938 Bytes::new(&payload_buf)
6939 } else {
6940 Bytes::new(__input)
6941 };
6942 let mut __struct = Self::default();
6943 __struct.current_consumed = buf.get_i32_le();
6944 __struct.energy_consumed = buf.get_i32_le();
6945 __struct.temperature = buf.get_i16_le();
6946 for v in &mut __struct.voltages {
6947 let val = buf.get_u16_le();
6948 *v = val;
6949 }
6950 __struct.current_battery = buf.get_i16_le();
6951 __struct.id = buf.get_u8();
6952 let tmp = buf.get_u8();
6953 __struct.battery_function =
6954 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
6955 enum_type: "MavBatteryFunction",
6956 value: tmp as u32,
6957 })?;
6958 let tmp = buf.get_u8();
6959 __struct.mavtype =
6960 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
6961 enum_type: "MavBatteryType",
6962 value: tmp as u32,
6963 })?;
6964 __struct.battery_remaining = buf.get_i8();
6965 __struct.time_remaining = buf.get_i32_le();
6966 let tmp = buf.get_u8();
6967 __struct.charge_state =
6968 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
6969 enum_type: "MavBatteryChargeState",
6970 value: tmp as u32,
6971 })?;
6972 for v in &mut __struct.voltages_ext {
6973 let val = buf.get_u16_le();
6974 *v = val;
6975 }
6976 let tmp = buf.get_u8();
6977 __struct.mode =
6978 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
6979 enum_type: "MavBatteryMode",
6980 value: tmp as u32,
6981 })?;
6982 let tmp = buf.get_u32_le();
6983 __struct.fault_bitmask = MavBatteryFault::from_bits(tmp & MavBatteryFault::all().bits())
6984 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
6985 flag_type: "MavBatteryFault",
6986 value: tmp as u32,
6987 })?;
6988 Ok(__struct)
6989 }
6990 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
6991 let mut __tmp = BytesMut::new(bytes);
6992 #[allow(clippy::absurd_extreme_comparisons)]
6993 #[allow(unused_comparisons)]
6994 if __tmp.remaining() < Self::ENCODED_LEN {
6995 panic!(
6996 "buffer is too small (need {} bytes, but got {})",
6997 Self::ENCODED_LEN,
6998 __tmp.remaining(),
6999 )
7000 }
7001 __tmp.put_i32_le(self.current_consumed);
7002 __tmp.put_i32_le(self.energy_consumed);
7003 __tmp.put_i16_le(self.temperature);
7004 for val in &self.voltages {
7005 __tmp.put_u16_le(*val);
7006 }
7007 __tmp.put_i16_le(self.current_battery);
7008 __tmp.put_u8(self.id);
7009 __tmp.put_u8(self.battery_function as u8);
7010 __tmp.put_u8(self.mavtype as u8);
7011 __tmp.put_i8(self.battery_remaining);
7012 if matches!(version, MavlinkVersion::V2) {
7013 __tmp.put_i32_le(self.time_remaining);
7014 __tmp.put_u8(self.charge_state as u8);
7015 for val in &self.voltages_ext {
7016 __tmp.put_u16_le(*val);
7017 }
7018 __tmp.put_u8(self.mode as u8);
7019 __tmp.put_u32_le(self.fault_bitmask.bits());
7020 let len = __tmp.len();
7021 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
7022 } else {
7023 __tmp.len()
7024 }
7025 }
7026}
7027#[doc = "Report button state change."]
7028#[doc = ""]
7029#[doc = "ID: 257"]
7030#[derive(Debug, Clone, PartialEq)]
7031#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
7032#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
7033pub struct BUTTON_CHANGE_DATA {
7034 #[doc = "Timestamp (time since system boot)."]
7035 pub time_boot_ms: u32,
7036 #[doc = "Time of last change of button state."]
7037 pub last_change_ms: u32,
7038 #[doc = "Bitmap for state of buttons."]
7039 pub state: u8,
7040}
7041impl BUTTON_CHANGE_DATA {
7042 pub const ENCODED_LEN: usize = 9usize;
7043 pub const DEFAULT: Self = Self {
7044 time_boot_ms: 0_u32,
7045 last_change_ms: 0_u32,
7046 state: 0_u8,
7047 };
7048 #[cfg(feature = "arbitrary")]
7049 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
7050 use arbitrary::{Arbitrary, Unstructured};
7051 let mut buf = [0u8; 1024];
7052 rng.fill_bytes(&mut buf);
7053 let mut unstructured = Unstructured::new(&buf);
7054 Self::arbitrary(&mut unstructured).unwrap_or_default()
7055 }
7056}
7057impl Default for BUTTON_CHANGE_DATA {
7058 fn default() -> Self {
7059 Self::DEFAULT.clone()
7060 }
7061}
7062impl MessageData for BUTTON_CHANGE_DATA {
7063 type Message = MavMessage;
7064 const ID: u32 = 257u32;
7065 const NAME: &'static str = "BUTTON_CHANGE";
7066 const EXTRA_CRC: u8 = 131u8;
7067 const ENCODED_LEN: usize = 9usize;
7068 fn deser(
7069 _version: MavlinkVersion,
7070 __input: &[u8],
7071 ) -> Result<Self, ::mavlink_core::error::ParserError> {
7072 let avail_len = __input.len();
7073 let mut payload_buf = [0; Self::ENCODED_LEN];
7074 let mut buf = if avail_len < Self::ENCODED_LEN {
7075 payload_buf[0..avail_len].copy_from_slice(__input);
7076 Bytes::new(&payload_buf)
7077 } else {
7078 Bytes::new(__input)
7079 };
7080 let mut __struct = Self::default();
7081 __struct.time_boot_ms = buf.get_u32_le();
7082 __struct.last_change_ms = buf.get_u32_le();
7083 __struct.state = buf.get_u8();
7084 Ok(__struct)
7085 }
7086 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
7087 let mut __tmp = BytesMut::new(bytes);
7088 #[allow(clippy::absurd_extreme_comparisons)]
7089 #[allow(unused_comparisons)]
7090 if __tmp.remaining() < Self::ENCODED_LEN {
7091 panic!(
7092 "buffer is too small (need {} bytes, but got {})",
7093 Self::ENCODED_LEN,
7094 __tmp.remaining(),
7095 )
7096 }
7097 __tmp.put_u32_le(self.time_boot_ms);
7098 __tmp.put_u32_le(self.last_change_ms);
7099 __tmp.put_u8(self.state);
7100 if matches!(version, MavlinkVersion::V2) {
7101 let len = __tmp.len();
7102 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
7103 } else {
7104 __tmp.len()
7105 }
7106 }
7107}
7108#[doc = "Information about the status of a capture. Can be requested with a MAV_CMD_REQUEST_MESSAGE command."]
7109#[doc = ""]
7110#[doc = "ID: 262"]
7111#[derive(Debug, Clone, PartialEq)]
7112#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
7113#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
7114pub struct CAMERA_CAPTURE_STATUS_DATA {
7115 #[doc = "Timestamp (time since system boot)."]
7116 pub time_boot_ms: u32,
7117 #[doc = "Image capture interval"]
7118 pub image_interval: f32,
7119 #[doc = "Elapsed time since recording started (0: Not supported/available). A GCS should compute recording time and use non-zero values of this field to correct any discrepancy."]
7120 pub recording_time_ms: u32,
7121 #[doc = "Available storage capacity."]
7122 pub available_capacity: f32,
7123 #[doc = "Current status of image capturing (0: idle, 1: capture in progress, 2: interval set but idle, 3: interval set and capture in progress)"]
7124 pub image_status: u8,
7125 #[doc = "Current status of video capturing (0: idle, 1: capture in progress)"]
7126 pub video_status: u8,
7127 #[doc = "Total number of images captured ('forever', or until reset using MAV_CMD_STORAGE_FORMAT)."]
7128 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
7129 pub image_count: i32,
7130 #[doc = "Camera id of a non-MAVLink camera attached to an autopilot (1-6). 0 if the component is a MAVLink camera (with its own component id)."]
7131 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
7132 pub camera_device_id: u8,
7133}
7134impl CAMERA_CAPTURE_STATUS_DATA {
7135 pub const ENCODED_LEN: usize = 23usize;
7136 pub const DEFAULT: Self = Self {
7137 time_boot_ms: 0_u32,
7138 image_interval: 0.0_f32,
7139 recording_time_ms: 0_u32,
7140 available_capacity: 0.0_f32,
7141 image_status: 0_u8,
7142 video_status: 0_u8,
7143 image_count: 0_i32,
7144 camera_device_id: 0_u8,
7145 };
7146 #[cfg(feature = "arbitrary")]
7147 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
7148 use arbitrary::{Arbitrary, Unstructured};
7149 let mut buf = [0u8; 1024];
7150 rng.fill_bytes(&mut buf);
7151 let mut unstructured = Unstructured::new(&buf);
7152 Self::arbitrary(&mut unstructured).unwrap_or_default()
7153 }
7154}
7155impl Default for CAMERA_CAPTURE_STATUS_DATA {
7156 fn default() -> Self {
7157 Self::DEFAULT.clone()
7158 }
7159}
7160impl MessageData for CAMERA_CAPTURE_STATUS_DATA {
7161 type Message = MavMessage;
7162 const ID: u32 = 262u32;
7163 const NAME: &'static str = "CAMERA_CAPTURE_STATUS";
7164 const EXTRA_CRC: u8 = 12u8;
7165 const ENCODED_LEN: usize = 23usize;
7166 fn deser(
7167 _version: MavlinkVersion,
7168 __input: &[u8],
7169 ) -> Result<Self, ::mavlink_core::error::ParserError> {
7170 let avail_len = __input.len();
7171 let mut payload_buf = [0; Self::ENCODED_LEN];
7172 let mut buf = if avail_len < Self::ENCODED_LEN {
7173 payload_buf[0..avail_len].copy_from_slice(__input);
7174 Bytes::new(&payload_buf)
7175 } else {
7176 Bytes::new(__input)
7177 };
7178 let mut __struct = Self::default();
7179 __struct.time_boot_ms = buf.get_u32_le();
7180 __struct.image_interval = buf.get_f32_le();
7181 __struct.recording_time_ms = buf.get_u32_le();
7182 __struct.available_capacity = buf.get_f32_le();
7183 __struct.image_status = buf.get_u8();
7184 __struct.video_status = buf.get_u8();
7185 __struct.image_count = buf.get_i32_le();
7186 __struct.camera_device_id = buf.get_u8();
7187 Ok(__struct)
7188 }
7189 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
7190 let mut __tmp = BytesMut::new(bytes);
7191 #[allow(clippy::absurd_extreme_comparisons)]
7192 #[allow(unused_comparisons)]
7193 if __tmp.remaining() < Self::ENCODED_LEN {
7194 panic!(
7195 "buffer is too small (need {} bytes, but got {})",
7196 Self::ENCODED_LEN,
7197 __tmp.remaining(),
7198 )
7199 }
7200 __tmp.put_u32_le(self.time_boot_ms);
7201 __tmp.put_f32_le(self.image_interval);
7202 __tmp.put_u32_le(self.recording_time_ms);
7203 __tmp.put_f32_le(self.available_capacity);
7204 __tmp.put_u8(self.image_status);
7205 __tmp.put_u8(self.video_status);
7206 if matches!(version, MavlinkVersion::V2) {
7207 __tmp.put_i32_le(self.image_count);
7208 __tmp.put_u8(self.camera_device_id);
7209 let len = __tmp.len();
7210 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
7211 } else {
7212 __tmp.len()
7213 }
7214 }
7215}
7216#[doc = "Information about the field of view of a camera. Can be requested with a MAV_CMD_REQUEST_MESSAGE command."]
7217#[doc = ""]
7218#[doc = "ID: 271"]
7219#[derive(Debug, Clone, PartialEq)]
7220#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
7221#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
7222pub struct CAMERA_FOV_STATUS_DATA {
7223 #[doc = "Timestamp (time since system boot)."]
7224 pub time_boot_ms: u32,
7225 #[doc = "Latitude of camera (INT32_MAX if unknown)."]
7226 pub lat_camera: i32,
7227 #[doc = "Longitude of camera (INT32_MAX if unknown)."]
7228 pub lon_camera: i32,
7229 #[doc = "Altitude (MSL) of camera (INT32_MAX if unknown)."]
7230 pub alt_camera: i32,
7231 #[doc = "Latitude of center of image (INT32_MAX if unknown, INT32_MIN if at infinity, not intersecting with horizon)."]
7232 pub lat_image: i32,
7233 #[doc = "Longitude of center of image (INT32_MAX if unknown, INT32_MIN if at infinity, not intersecting with horizon)."]
7234 pub lon_image: i32,
7235 #[doc = "Altitude (MSL) of center of image (INT32_MAX if unknown, INT32_MIN if at infinity, not intersecting with horizon)."]
7236 pub alt_image: i32,
7237 #[doc = "Quaternion of camera orientation (w, x, y, z order, zero-rotation is 1, 0, 0, 0)"]
7238 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
7239 pub q: [f32; 4],
7240 #[doc = "Horizontal field of view (NaN if unknown)."]
7241 pub hfov: f32,
7242 #[doc = "Vertical field of view (NaN if unknown)."]
7243 pub vfov: f32,
7244 #[doc = "Camera id of a non-MAVLink camera attached to an autopilot (1-6). 0 if the component is a MAVLink camera (with its own component id)."]
7245 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
7246 pub camera_device_id: u8,
7247}
7248impl CAMERA_FOV_STATUS_DATA {
7249 pub const ENCODED_LEN: usize = 53usize;
7250 pub const DEFAULT: Self = Self {
7251 time_boot_ms: 0_u32,
7252 lat_camera: 0_i32,
7253 lon_camera: 0_i32,
7254 alt_camera: 0_i32,
7255 lat_image: 0_i32,
7256 lon_image: 0_i32,
7257 alt_image: 0_i32,
7258 q: [0.0_f32; 4usize],
7259 hfov: 0.0_f32,
7260 vfov: 0.0_f32,
7261 camera_device_id: 0_u8,
7262 };
7263 #[cfg(feature = "arbitrary")]
7264 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
7265 use arbitrary::{Arbitrary, Unstructured};
7266 let mut buf = [0u8; 1024];
7267 rng.fill_bytes(&mut buf);
7268 let mut unstructured = Unstructured::new(&buf);
7269 Self::arbitrary(&mut unstructured).unwrap_or_default()
7270 }
7271}
7272impl Default for CAMERA_FOV_STATUS_DATA {
7273 fn default() -> Self {
7274 Self::DEFAULT.clone()
7275 }
7276}
7277impl MessageData for CAMERA_FOV_STATUS_DATA {
7278 type Message = MavMessage;
7279 const ID: u32 = 271u32;
7280 const NAME: &'static str = "CAMERA_FOV_STATUS";
7281 const EXTRA_CRC: u8 = 22u8;
7282 const ENCODED_LEN: usize = 53usize;
7283 fn deser(
7284 _version: MavlinkVersion,
7285 __input: &[u8],
7286 ) -> Result<Self, ::mavlink_core::error::ParserError> {
7287 let avail_len = __input.len();
7288 let mut payload_buf = [0; Self::ENCODED_LEN];
7289 let mut buf = if avail_len < Self::ENCODED_LEN {
7290 payload_buf[0..avail_len].copy_from_slice(__input);
7291 Bytes::new(&payload_buf)
7292 } else {
7293 Bytes::new(__input)
7294 };
7295 let mut __struct = Self::default();
7296 __struct.time_boot_ms = buf.get_u32_le();
7297 __struct.lat_camera = buf.get_i32_le();
7298 __struct.lon_camera = buf.get_i32_le();
7299 __struct.alt_camera = buf.get_i32_le();
7300 __struct.lat_image = buf.get_i32_le();
7301 __struct.lon_image = buf.get_i32_le();
7302 __struct.alt_image = buf.get_i32_le();
7303 for v in &mut __struct.q {
7304 let val = buf.get_f32_le();
7305 *v = val;
7306 }
7307 __struct.hfov = buf.get_f32_le();
7308 __struct.vfov = buf.get_f32_le();
7309 __struct.camera_device_id = buf.get_u8();
7310 Ok(__struct)
7311 }
7312 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
7313 let mut __tmp = BytesMut::new(bytes);
7314 #[allow(clippy::absurd_extreme_comparisons)]
7315 #[allow(unused_comparisons)]
7316 if __tmp.remaining() < Self::ENCODED_LEN {
7317 panic!(
7318 "buffer is too small (need {} bytes, but got {})",
7319 Self::ENCODED_LEN,
7320 __tmp.remaining(),
7321 )
7322 }
7323 __tmp.put_u32_le(self.time_boot_ms);
7324 __tmp.put_i32_le(self.lat_camera);
7325 __tmp.put_i32_le(self.lon_camera);
7326 __tmp.put_i32_le(self.alt_camera);
7327 __tmp.put_i32_le(self.lat_image);
7328 __tmp.put_i32_le(self.lon_image);
7329 __tmp.put_i32_le(self.alt_image);
7330 for val in &self.q {
7331 __tmp.put_f32_le(*val);
7332 }
7333 __tmp.put_f32_le(self.hfov);
7334 __tmp.put_f32_le(self.vfov);
7335 if matches!(version, MavlinkVersion::V2) {
7336 __tmp.put_u8(self.camera_device_id);
7337 let len = __tmp.len();
7338 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
7339 } else {
7340 __tmp.len()
7341 }
7342 }
7343}
7344#[doc = "Information about a captured image. This is emitted every time a message is captured. MAV_CMD_REQUEST_MESSAGE can be used to (re)request this message for a specific sequence number or range of sequence numbers: MAV_CMD_REQUEST_MESSAGE.param2 indicates the sequence number the first image to send, or set to -1 to send the message for all sequence numbers. MAV_CMD_REQUEST_MESSAGE.param3 is used to specify a range of messages to send: set to 0 (default) to send just the the message for the sequence number in param 2, set to -1 to send the message for the sequence number in param 2 and all the following sequence numbers, set to the sequence number of the final message in the range."]
7345#[doc = ""]
7346#[doc = "ID: 263"]
7347#[derive(Debug, Clone, PartialEq)]
7348#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
7349#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
7350pub struct CAMERA_IMAGE_CAPTURED_DATA {
7351 #[doc = "Timestamp (time since UNIX epoch) in UTC. 0 for unknown."]
7352 pub time_utc: u64,
7353 #[doc = "Timestamp (time since system boot)."]
7354 pub time_boot_ms: u32,
7355 #[doc = "Latitude where image was taken"]
7356 pub lat: i32,
7357 #[doc = "Longitude where capture was taken"]
7358 pub lon: i32,
7359 #[doc = "Altitude (MSL) where image was taken"]
7360 pub alt: i32,
7361 #[doc = "Altitude above ground"]
7362 pub relative_alt: i32,
7363 #[doc = "Quaternion of camera orientation (w, x, y, z order, zero-rotation is 1, 0, 0, 0)"]
7364 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
7365 pub q: [f32; 4],
7366 #[doc = "Zero based index of this image (i.e. a new image will have index CAMERA_CAPTURE_STATUS.image count -1)"]
7367 pub image_index: i32,
7368 #[doc = "Camera id of a non-MAVLink camera attached to an autopilot (1-6). 0 if the component is a MAVLink camera (with its own component id). Field name is usually camera_device_id."]
7369 pub camera_id: u8,
7370 #[doc = "Boolean indicating success (1) or failure (0) while capturing this image."]
7371 pub capture_result: i8,
7372 #[doc = "URL of image taken. Either local storage or <http://foo.jpg> if camera provides an HTTP interface."]
7373 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
7374 pub file_url: [u8; 205],
7375}
7376impl CAMERA_IMAGE_CAPTURED_DATA {
7377 pub const ENCODED_LEN: usize = 255usize;
7378 pub const DEFAULT: Self = Self {
7379 time_utc: 0_u64,
7380 time_boot_ms: 0_u32,
7381 lat: 0_i32,
7382 lon: 0_i32,
7383 alt: 0_i32,
7384 relative_alt: 0_i32,
7385 q: [0.0_f32; 4usize],
7386 image_index: 0_i32,
7387 camera_id: 0_u8,
7388 capture_result: 0_i8,
7389 file_url: [0_u8; 205usize],
7390 };
7391 #[cfg(feature = "arbitrary")]
7392 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
7393 use arbitrary::{Arbitrary, Unstructured};
7394 let mut buf = [0u8; 1024];
7395 rng.fill_bytes(&mut buf);
7396 let mut unstructured = Unstructured::new(&buf);
7397 Self::arbitrary(&mut unstructured).unwrap_or_default()
7398 }
7399}
7400impl Default for CAMERA_IMAGE_CAPTURED_DATA {
7401 fn default() -> Self {
7402 Self::DEFAULT.clone()
7403 }
7404}
7405impl MessageData for CAMERA_IMAGE_CAPTURED_DATA {
7406 type Message = MavMessage;
7407 const ID: u32 = 263u32;
7408 const NAME: &'static str = "CAMERA_IMAGE_CAPTURED";
7409 const EXTRA_CRC: u8 = 133u8;
7410 const ENCODED_LEN: usize = 255usize;
7411 fn deser(
7412 _version: MavlinkVersion,
7413 __input: &[u8],
7414 ) -> Result<Self, ::mavlink_core::error::ParserError> {
7415 let avail_len = __input.len();
7416 let mut payload_buf = [0; Self::ENCODED_LEN];
7417 let mut buf = if avail_len < Self::ENCODED_LEN {
7418 payload_buf[0..avail_len].copy_from_slice(__input);
7419 Bytes::new(&payload_buf)
7420 } else {
7421 Bytes::new(__input)
7422 };
7423 let mut __struct = Self::default();
7424 __struct.time_utc = buf.get_u64_le();
7425 __struct.time_boot_ms = buf.get_u32_le();
7426 __struct.lat = buf.get_i32_le();
7427 __struct.lon = buf.get_i32_le();
7428 __struct.alt = buf.get_i32_le();
7429 __struct.relative_alt = buf.get_i32_le();
7430 for v in &mut __struct.q {
7431 let val = buf.get_f32_le();
7432 *v = val;
7433 }
7434 __struct.image_index = buf.get_i32_le();
7435 __struct.camera_id = buf.get_u8();
7436 __struct.capture_result = buf.get_i8();
7437 for v in &mut __struct.file_url {
7438 let val = buf.get_u8();
7439 *v = val;
7440 }
7441 Ok(__struct)
7442 }
7443 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
7444 let mut __tmp = BytesMut::new(bytes);
7445 #[allow(clippy::absurd_extreme_comparisons)]
7446 #[allow(unused_comparisons)]
7447 if __tmp.remaining() < Self::ENCODED_LEN {
7448 panic!(
7449 "buffer is too small (need {} bytes, but got {})",
7450 Self::ENCODED_LEN,
7451 __tmp.remaining(),
7452 )
7453 }
7454 __tmp.put_u64_le(self.time_utc);
7455 __tmp.put_u32_le(self.time_boot_ms);
7456 __tmp.put_i32_le(self.lat);
7457 __tmp.put_i32_le(self.lon);
7458 __tmp.put_i32_le(self.alt);
7459 __tmp.put_i32_le(self.relative_alt);
7460 for val in &self.q {
7461 __tmp.put_f32_le(*val);
7462 }
7463 __tmp.put_i32_le(self.image_index);
7464 __tmp.put_u8(self.camera_id);
7465 __tmp.put_i8(self.capture_result);
7466 for val in &self.file_url {
7467 __tmp.put_u8(*val);
7468 }
7469 if matches!(version, MavlinkVersion::V2) {
7470 let len = __tmp.len();
7471 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
7472 } else {
7473 __tmp.len()
7474 }
7475 }
7476}
7477#[doc = "Information about a camera. Can be requested with a MAV_CMD_REQUEST_MESSAGE command."]
7478#[doc = ""]
7479#[doc = "ID: 259"]
7480#[derive(Debug, Clone, PartialEq)]
7481#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
7482#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
7483pub struct CAMERA_INFORMATION_DATA {
7484 #[doc = "Timestamp (time since system boot)."]
7485 pub time_boot_ms: u32,
7486 #[doc = "0xff). Use 0 if not known."]
7487 pub firmware_version: u32,
7488 #[doc = "Focal length. Use NaN if not known."]
7489 pub focal_length: f32,
7490 #[doc = "Image sensor size horizontal. Use NaN if not known."]
7491 pub sensor_size_h: f32,
7492 #[doc = "Image sensor size vertical. Use NaN if not known."]
7493 pub sensor_size_v: f32,
7494 #[doc = "Bitmap of camera capability flags."]
7495 pub flags: CameraCapFlags,
7496 #[doc = "Horizontal image resolution. Use 0 if not known."]
7497 pub resolution_h: u16,
7498 #[doc = "Vertical image resolution. Use 0 if not known."]
7499 pub resolution_v: u16,
7500 #[doc = "Camera definition version (iteration). Use 0 if not known."]
7501 pub cam_definition_version: u16,
7502 #[doc = "Name of the camera vendor"]
7503 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
7504 pub vendor_name: [u8; 32],
7505 #[doc = "Name of the camera model"]
7506 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
7507 pub model_name: [u8; 32],
7508 #[doc = "Reserved for a lens ID. Use 0 if not known."]
7509 pub lens_id: u8,
7510 #[doc = "Camera definition URI (if any, otherwise only basic functions will be available). HTTP- (http://) and MAVLink FTP- (mavlinkftp://) formatted URIs are allowed (and both must be supported by any GCS that implements the Camera Protocol). The definition file may be xz compressed, which will be indicated by the file extension .xml.xz (a GCS that implements the protocol must support decompressing the file). The string needs to be zero terminated. Use a zero-length string if not known."]
7511 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
7512 pub cam_definition_uri: [u8; 140],
7513 #[doc = "Gimbal id of a gimbal associated with this camera. This is the component id of the gimbal device, or 1-6 for non mavlink gimbals. Use 0 if no gimbal is associated with the camera."]
7514 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
7515 pub gimbal_device_id: u8,
7516 #[doc = "Camera id of a non-MAVLink camera attached to an autopilot (1-6). 0 if the component is a MAVLink camera (with its own component id)."]
7517 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
7518 pub camera_device_id: u8,
7519}
7520impl CAMERA_INFORMATION_DATA {
7521 pub const ENCODED_LEN: usize = 237usize;
7522 pub const DEFAULT: Self = Self {
7523 time_boot_ms: 0_u32,
7524 firmware_version: 0_u32,
7525 focal_length: 0.0_f32,
7526 sensor_size_h: 0.0_f32,
7527 sensor_size_v: 0.0_f32,
7528 flags: CameraCapFlags::DEFAULT,
7529 resolution_h: 0_u16,
7530 resolution_v: 0_u16,
7531 cam_definition_version: 0_u16,
7532 vendor_name: [0_u8; 32usize],
7533 model_name: [0_u8; 32usize],
7534 lens_id: 0_u8,
7535 cam_definition_uri: [0_u8; 140usize],
7536 gimbal_device_id: 0_u8,
7537 camera_device_id: 0_u8,
7538 };
7539 #[cfg(feature = "arbitrary")]
7540 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
7541 use arbitrary::{Arbitrary, Unstructured};
7542 let mut buf = [0u8; 1024];
7543 rng.fill_bytes(&mut buf);
7544 let mut unstructured = Unstructured::new(&buf);
7545 Self::arbitrary(&mut unstructured).unwrap_or_default()
7546 }
7547}
7548impl Default for CAMERA_INFORMATION_DATA {
7549 fn default() -> Self {
7550 Self::DEFAULT.clone()
7551 }
7552}
7553impl MessageData for CAMERA_INFORMATION_DATA {
7554 type Message = MavMessage;
7555 const ID: u32 = 259u32;
7556 const NAME: &'static str = "CAMERA_INFORMATION";
7557 const EXTRA_CRC: u8 = 92u8;
7558 const ENCODED_LEN: usize = 237usize;
7559 fn deser(
7560 _version: MavlinkVersion,
7561 __input: &[u8],
7562 ) -> Result<Self, ::mavlink_core::error::ParserError> {
7563 let avail_len = __input.len();
7564 let mut payload_buf = [0; Self::ENCODED_LEN];
7565 let mut buf = if avail_len < Self::ENCODED_LEN {
7566 payload_buf[0..avail_len].copy_from_slice(__input);
7567 Bytes::new(&payload_buf)
7568 } else {
7569 Bytes::new(__input)
7570 };
7571 let mut __struct = Self::default();
7572 __struct.time_boot_ms = buf.get_u32_le();
7573 __struct.firmware_version = buf.get_u32_le();
7574 __struct.focal_length = buf.get_f32_le();
7575 __struct.sensor_size_h = buf.get_f32_le();
7576 __struct.sensor_size_v = buf.get_f32_le();
7577 let tmp = buf.get_u32_le();
7578 __struct.flags = CameraCapFlags::from_bits(tmp & CameraCapFlags::all().bits()).ok_or(
7579 ::mavlink_core::error::ParserError::InvalidFlag {
7580 flag_type: "CameraCapFlags",
7581 value: tmp as u32,
7582 },
7583 )?;
7584 __struct.resolution_h = buf.get_u16_le();
7585 __struct.resolution_v = buf.get_u16_le();
7586 __struct.cam_definition_version = buf.get_u16_le();
7587 for v in &mut __struct.vendor_name {
7588 let val = buf.get_u8();
7589 *v = val;
7590 }
7591 for v in &mut __struct.model_name {
7592 let val = buf.get_u8();
7593 *v = val;
7594 }
7595 __struct.lens_id = buf.get_u8();
7596 for v in &mut __struct.cam_definition_uri {
7597 let val = buf.get_u8();
7598 *v = val;
7599 }
7600 __struct.gimbal_device_id = buf.get_u8();
7601 __struct.camera_device_id = buf.get_u8();
7602 Ok(__struct)
7603 }
7604 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
7605 let mut __tmp = BytesMut::new(bytes);
7606 #[allow(clippy::absurd_extreme_comparisons)]
7607 #[allow(unused_comparisons)]
7608 if __tmp.remaining() < Self::ENCODED_LEN {
7609 panic!(
7610 "buffer is too small (need {} bytes, but got {})",
7611 Self::ENCODED_LEN,
7612 __tmp.remaining(),
7613 )
7614 }
7615 __tmp.put_u32_le(self.time_boot_ms);
7616 __tmp.put_u32_le(self.firmware_version);
7617 __tmp.put_f32_le(self.focal_length);
7618 __tmp.put_f32_le(self.sensor_size_h);
7619 __tmp.put_f32_le(self.sensor_size_v);
7620 __tmp.put_u32_le(self.flags.bits());
7621 __tmp.put_u16_le(self.resolution_h);
7622 __tmp.put_u16_le(self.resolution_v);
7623 __tmp.put_u16_le(self.cam_definition_version);
7624 for val in &self.vendor_name {
7625 __tmp.put_u8(*val);
7626 }
7627 for val in &self.model_name {
7628 __tmp.put_u8(*val);
7629 }
7630 __tmp.put_u8(self.lens_id);
7631 for val in &self.cam_definition_uri {
7632 __tmp.put_u8(*val);
7633 }
7634 if matches!(version, MavlinkVersion::V2) {
7635 __tmp.put_u8(self.gimbal_device_id);
7636 __tmp.put_u8(self.camera_device_id);
7637 let len = __tmp.len();
7638 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
7639 } else {
7640 __tmp.len()
7641 }
7642 }
7643}
7644#[doc = "Settings of a camera. Can be requested with a MAV_CMD_REQUEST_MESSAGE command."]
7645#[doc = ""]
7646#[doc = "ID: 260"]
7647#[derive(Debug, Clone, PartialEq)]
7648#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
7649#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
7650pub struct CAMERA_SETTINGS_DATA {
7651 #[doc = "Timestamp (time since system boot)."]
7652 pub time_boot_ms: u32,
7653 #[doc = "Camera mode"]
7654 pub mode_id: CameraMode,
7655 #[doc = "Current zoom level as a percentage of the full range (0.0 to 100.0, NaN if not known)"]
7656 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
7657 pub zoomLevel: f32,
7658 #[doc = "Current focus level as a percentage of the full range (0.0 to 100.0, NaN if not known)"]
7659 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
7660 pub focusLevel: f32,
7661 #[doc = "Camera id of a non-MAVLink camera attached to an autopilot (1-6). 0 if the component is a MAVLink camera (with its own component id)."]
7662 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
7663 pub camera_device_id: u8,
7664}
7665impl CAMERA_SETTINGS_DATA {
7666 pub const ENCODED_LEN: usize = 14usize;
7667 pub const DEFAULT: Self = Self {
7668 time_boot_ms: 0_u32,
7669 mode_id: CameraMode::DEFAULT,
7670 zoomLevel: 0.0_f32,
7671 focusLevel: 0.0_f32,
7672 camera_device_id: 0_u8,
7673 };
7674 #[cfg(feature = "arbitrary")]
7675 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
7676 use arbitrary::{Arbitrary, Unstructured};
7677 let mut buf = [0u8; 1024];
7678 rng.fill_bytes(&mut buf);
7679 let mut unstructured = Unstructured::new(&buf);
7680 Self::arbitrary(&mut unstructured).unwrap_or_default()
7681 }
7682}
7683impl Default for CAMERA_SETTINGS_DATA {
7684 fn default() -> Self {
7685 Self::DEFAULT.clone()
7686 }
7687}
7688impl MessageData for CAMERA_SETTINGS_DATA {
7689 type Message = MavMessage;
7690 const ID: u32 = 260u32;
7691 const NAME: &'static str = "CAMERA_SETTINGS";
7692 const EXTRA_CRC: u8 = 146u8;
7693 const ENCODED_LEN: usize = 14usize;
7694 fn deser(
7695 _version: MavlinkVersion,
7696 __input: &[u8],
7697 ) -> Result<Self, ::mavlink_core::error::ParserError> {
7698 let avail_len = __input.len();
7699 let mut payload_buf = [0; Self::ENCODED_LEN];
7700 let mut buf = if avail_len < Self::ENCODED_LEN {
7701 payload_buf[0..avail_len].copy_from_slice(__input);
7702 Bytes::new(&payload_buf)
7703 } else {
7704 Bytes::new(__input)
7705 };
7706 let mut __struct = Self::default();
7707 __struct.time_boot_ms = buf.get_u32_le();
7708 let tmp = buf.get_u8();
7709 __struct.mode_id =
7710 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
7711 enum_type: "CameraMode",
7712 value: tmp as u32,
7713 })?;
7714 __struct.zoomLevel = buf.get_f32_le();
7715 __struct.focusLevel = buf.get_f32_le();
7716 __struct.camera_device_id = buf.get_u8();
7717 Ok(__struct)
7718 }
7719 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
7720 let mut __tmp = BytesMut::new(bytes);
7721 #[allow(clippy::absurd_extreme_comparisons)]
7722 #[allow(unused_comparisons)]
7723 if __tmp.remaining() < Self::ENCODED_LEN {
7724 panic!(
7725 "buffer is too small (need {} bytes, but got {})",
7726 Self::ENCODED_LEN,
7727 __tmp.remaining(),
7728 )
7729 }
7730 __tmp.put_u32_le(self.time_boot_ms);
7731 __tmp.put_u8(self.mode_id as u8);
7732 if matches!(version, MavlinkVersion::V2) {
7733 __tmp.put_f32_le(self.zoomLevel);
7734 __tmp.put_f32_le(self.focusLevel);
7735 __tmp.put_u8(self.camera_device_id);
7736 let len = __tmp.len();
7737 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
7738 } else {
7739 __tmp.len()
7740 }
7741 }
7742}
7743#[doc = "Camera absolute thermal range. This can be streamed when the associated VIDEO_STREAM_STATUS `flag` field bit VIDEO_STREAM_STATUS_FLAGS_THERMAL_RANGE_ENABLED is set, but a GCS may choose to only request it for the current active stream. Use MAV_CMD_SET_MESSAGE_INTERVAL to define message interval (param3 indicates the stream id of the current camera, or 0 for all streams, param4 indicates the target camera_device_id for autopilot-attached cameras or 0 for MAVLink cameras)."]
7744#[doc = ""]
7745#[doc = "ID: 277"]
7746#[derive(Debug, Clone, PartialEq)]
7747#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
7748#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
7749pub struct CAMERA_THERMAL_RANGE_DATA {
7750 #[doc = "Timestamp (time since system boot)."]
7751 pub time_boot_ms: u32,
7752 #[doc = "Temperature max."]
7753 pub max: f32,
7754 #[doc = "Temperature max point x value (normalized 0..1, 0 is left, 1 is right), NAN if unknown."]
7755 pub max_point_x: f32,
7756 #[doc = "Temperature max point y value (normalized 0..1, 0 is top, 1 is bottom), NAN if unknown."]
7757 pub max_point_y: f32,
7758 #[doc = "Temperature min."]
7759 pub min: f32,
7760 #[doc = "Temperature min point x value (normalized 0..1, 0 is left, 1 is right), NAN if unknown."]
7761 pub min_point_x: f32,
7762 #[doc = "Temperature min point y value (normalized 0..1, 0 is top, 1 is bottom), NAN if unknown."]
7763 pub min_point_y: f32,
7764 #[doc = "Video Stream ID (1 for first, 2 for second, etc.)"]
7765 pub stream_id: u8,
7766 #[doc = "Camera id of a non-MAVLink camera attached to an autopilot (1-6). 0 if the component is a MAVLink camera (with its own component id)."]
7767 pub camera_device_id: u8,
7768}
7769impl CAMERA_THERMAL_RANGE_DATA {
7770 pub const ENCODED_LEN: usize = 30usize;
7771 pub const DEFAULT: Self = Self {
7772 time_boot_ms: 0_u32,
7773 max: 0.0_f32,
7774 max_point_x: 0.0_f32,
7775 max_point_y: 0.0_f32,
7776 min: 0.0_f32,
7777 min_point_x: 0.0_f32,
7778 min_point_y: 0.0_f32,
7779 stream_id: 0_u8,
7780 camera_device_id: 0_u8,
7781 };
7782 #[cfg(feature = "arbitrary")]
7783 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
7784 use arbitrary::{Arbitrary, Unstructured};
7785 let mut buf = [0u8; 1024];
7786 rng.fill_bytes(&mut buf);
7787 let mut unstructured = Unstructured::new(&buf);
7788 Self::arbitrary(&mut unstructured).unwrap_or_default()
7789 }
7790}
7791impl Default for CAMERA_THERMAL_RANGE_DATA {
7792 fn default() -> Self {
7793 Self::DEFAULT.clone()
7794 }
7795}
7796impl MessageData for CAMERA_THERMAL_RANGE_DATA {
7797 type Message = MavMessage;
7798 const ID: u32 = 277u32;
7799 const NAME: &'static str = "CAMERA_THERMAL_RANGE";
7800 const EXTRA_CRC: u8 = 62u8;
7801 const ENCODED_LEN: usize = 30usize;
7802 fn deser(
7803 _version: MavlinkVersion,
7804 __input: &[u8],
7805 ) -> Result<Self, ::mavlink_core::error::ParserError> {
7806 let avail_len = __input.len();
7807 let mut payload_buf = [0; Self::ENCODED_LEN];
7808 let mut buf = if avail_len < Self::ENCODED_LEN {
7809 payload_buf[0..avail_len].copy_from_slice(__input);
7810 Bytes::new(&payload_buf)
7811 } else {
7812 Bytes::new(__input)
7813 };
7814 let mut __struct = Self::default();
7815 __struct.time_boot_ms = buf.get_u32_le();
7816 __struct.max = buf.get_f32_le();
7817 __struct.max_point_x = buf.get_f32_le();
7818 __struct.max_point_y = buf.get_f32_le();
7819 __struct.min = buf.get_f32_le();
7820 __struct.min_point_x = buf.get_f32_le();
7821 __struct.min_point_y = buf.get_f32_le();
7822 __struct.stream_id = buf.get_u8();
7823 __struct.camera_device_id = buf.get_u8();
7824 Ok(__struct)
7825 }
7826 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
7827 let mut __tmp = BytesMut::new(bytes);
7828 #[allow(clippy::absurd_extreme_comparisons)]
7829 #[allow(unused_comparisons)]
7830 if __tmp.remaining() < Self::ENCODED_LEN {
7831 panic!(
7832 "buffer is too small (need {} bytes, but got {})",
7833 Self::ENCODED_LEN,
7834 __tmp.remaining(),
7835 )
7836 }
7837 __tmp.put_u32_le(self.time_boot_ms);
7838 __tmp.put_f32_le(self.max);
7839 __tmp.put_f32_le(self.max_point_x);
7840 __tmp.put_f32_le(self.max_point_y);
7841 __tmp.put_f32_le(self.min);
7842 __tmp.put_f32_le(self.min_point_x);
7843 __tmp.put_f32_le(self.min_point_y);
7844 __tmp.put_u8(self.stream_id);
7845 __tmp.put_u8(self.camera_device_id);
7846 if matches!(version, MavlinkVersion::V2) {
7847 let len = __tmp.len();
7848 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
7849 } else {
7850 __tmp.len()
7851 }
7852 }
7853}
7854#[doc = "Camera tracking status, sent while in active tracking. Use MAV_CMD_SET_MESSAGE_INTERVAL to define message interval."]
7855#[doc = ""]
7856#[doc = "ID: 276"]
7857#[derive(Debug, Clone, PartialEq)]
7858#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
7859#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
7860pub struct CAMERA_TRACKING_GEO_STATUS_DATA {
7861 #[doc = "Latitude of tracked object"]
7862 pub lat: i32,
7863 #[doc = "Longitude of tracked object"]
7864 pub lon: i32,
7865 #[doc = "Altitude of tracked object(AMSL, WGS84)"]
7866 pub alt: f32,
7867 #[doc = "Horizontal accuracy. NAN if unknown"]
7868 pub h_acc: f32,
7869 #[doc = "Vertical accuracy. NAN if unknown"]
7870 pub v_acc: f32,
7871 #[doc = "North velocity of tracked object. NAN if unknown"]
7872 pub vel_n: f32,
7873 #[doc = "East velocity of tracked object. NAN if unknown"]
7874 pub vel_e: f32,
7875 #[doc = "Down velocity of tracked object. NAN if unknown"]
7876 pub vel_d: f32,
7877 #[doc = "Velocity accuracy. NAN if unknown"]
7878 pub vel_acc: f32,
7879 #[doc = "Distance between camera and tracked object. NAN if unknown"]
7880 pub dist: f32,
7881 #[doc = "Heading in radians, in NED. NAN if unknown"]
7882 pub hdg: f32,
7883 #[doc = "Accuracy of heading, in NED. NAN if unknown"]
7884 pub hdg_acc: f32,
7885 #[doc = "Current tracking status"]
7886 pub tracking_status: CameraTrackingStatusFlags,
7887 #[doc = "Camera id of a non-MAVLink camera attached to an autopilot (1-6). 0 if the component is a MAVLink camera (with its own component id)."]
7888 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
7889 pub camera_device_id: u8,
7890}
7891impl CAMERA_TRACKING_GEO_STATUS_DATA {
7892 pub const ENCODED_LEN: usize = 50usize;
7893 pub const DEFAULT: Self = Self {
7894 lat: 0_i32,
7895 lon: 0_i32,
7896 alt: 0.0_f32,
7897 h_acc: 0.0_f32,
7898 v_acc: 0.0_f32,
7899 vel_n: 0.0_f32,
7900 vel_e: 0.0_f32,
7901 vel_d: 0.0_f32,
7902 vel_acc: 0.0_f32,
7903 dist: 0.0_f32,
7904 hdg: 0.0_f32,
7905 hdg_acc: 0.0_f32,
7906 tracking_status: CameraTrackingStatusFlags::DEFAULT,
7907 camera_device_id: 0_u8,
7908 };
7909 #[cfg(feature = "arbitrary")]
7910 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
7911 use arbitrary::{Arbitrary, Unstructured};
7912 let mut buf = [0u8; 1024];
7913 rng.fill_bytes(&mut buf);
7914 let mut unstructured = Unstructured::new(&buf);
7915 Self::arbitrary(&mut unstructured).unwrap_or_default()
7916 }
7917}
7918impl Default for CAMERA_TRACKING_GEO_STATUS_DATA {
7919 fn default() -> Self {
7920 Self::DEFAULT.clone()
7921 }
7922}
7923impl MessageData for CAMERA_TRACKING_GEO_STATUS_DATA {
7924 type Message = MavMessage;
7925 const ID: u32 = 276u32;
7926 const NAME: &'static str = "CAMERA_TRACKING_GEO_STATUS";
7927 const EXTRA_CRC: u8 = 18u8;
7928 const ENCODED_LEN: usize = 50usize;
7929 fn deser(
7930 _version: MavlinkVersion,
7931 __input: &[u8],
7932 ) -> Result<Self, ::mavlink_core::error::ParserError> {
7933 let avail_len = __input.len();
7934 let mut payload_buf = [0; Self::ENCODED_LEN];
7935 let mut buf = if avail_len < Self::ENCODED_LEN {
7936 payload_buf[0..avail_len].copy_from_slice(__input);
7937 Bytes::new(&payload_buf)
7938 } else {
7939 Bytes::new(__input)
7940 };
7941 let mut __struct = Self::default();
7942 __struct.lat = buf.get_i32_le();
7943 __struct.lon = buf.get_i32_le();
7944 __struct.alt = buf.get_f32_le();
7945 __struct.h_acc = buf.get_f32_le();
7946 __struct.v_acc = buf.get_f32_le();
7947 __struct.vel_n = buf.get_f32_le();
7948 __struct.vel_e = buf.get_f32_le();
7949 __struct.vel_d = buf.get_f32_le();
7950 __struct.vel_acc = buf.get_f32_le();
7951 __struct.dist = buf.get_f32_le();
7952 __struct.hdg = buf.get_f32_le();
7953 __struct.hdg_acc = buf.get_f32_le();
7954 let tmp = buf.get_u8();
7955 __struct.tracking_status =
7956 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
7957 enum_type: "CameraTrackingStatusFlags",
7958 value: tmp as u32,
7959 })?;
7960 __struct.camera_device_id = buf.get_u8();
7961 Ok(__struct)
7962 }
7963 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
7964 let mut __tmp = BytesMut::new(bytes);
7965 #[allow(clippy::absurd_extreme_comparisons)]
7966 #[allow(unused_comparisons)]
7967 if __tmp.remaining() < Self::ENCODED_LEN {
7968 panic!(
7969 "buffer is too small (need {} bytes, but got {})",
7970 Self::ENCODED_LEN,
7971 __tmp.remaining(),
7972 )
7973 }
7974 __tmp.put_i32_le(self.lat);
7975 __tmp.put_i32_le(self.lon);
7976 __tmp.put_f32_le(self.alt);
7977 __tmp.put_f32_le(self.h_acc);
7978 __tmp.put_f32_le(self.v_acc);
7979 __tmp.put_f32_le(self.vel_n);
7980 __tmp.put_f32_le(self.vel_e);
7981 __tmp.put_f32_le(self.vel_d);
7982 __tmp.put_f32_le(self.vel_acc);
7983 __tmp.put_f32_le(self.dist);
7984 __tmp.put_f32_le(self.hdg);
7985 __tmp.put_f32_le(self.hdg_acc);
7986 __tmp.put_u8(self.tracking_status as u8);
7987 if matches!(version, MavlinkVersion::V2) {
7988 __tmp.put_u8(self.camera_device_id);
7989 let len = __tmp.len();
7990 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
7991 } else {
7992 __tmp.len()
7993 }
7994 }
7995}
7996#[doc = "Camera tracking status, sent while in active tracking. Use MAV_CMD_SET_MESSAGE_INTERVAL to define message interval."]
7997#[doc = ""]
7998#[doc = "ID: 275"]
7999#[derive(Debug, Clone, PartialEq)]
8000#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
8001#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
8002pub struct CAMERA_TRACKING_IMAGE_STATUS_DATA {
8003 #[doc = "Current tracked point x value if CAMERA_TRACKING_MODE_POINT (normalized 0..1, 0 is left, 1 is right), NAN if unknown"]
8004 pub point_x: f32,
8005 #[doc = "Current tracked point y value if CAMERA_TRACKING_MODE_POINT (normalized 0..1, 0 is top, 1 is bottom), NAN if unknown"]
8006 pub point_y: f32,
8007 #[doc = "Current tracked radius if CAMERA_TRACKING_MODE_POINT (normalized 0..1, 0 is image left, 1 is image right), NAN if unknown"]
8008 pub radius: f32,
8009 #[doc = "Current tracked rectangle top x value if CAMERA_TRACKING_MODE_RECTANGLE (normalized 0..1, 0 is left, 1 is right), NAN if unknown"]
8010 pub rec_top_x: f32,
8011 #[doc = "Current tracked rectangle top y value if CAMERA_TRACKING_MODE_RECTANGLE (normalized 0..1, 0 is top, 1 is bottom), NAN if unknown"]
8012 pub rec_top_y: f32,
8013 #[doc = "Current tracked rectangle bottom x value if CAMERA_TRACKING_MODE_RECTANGLE (normalized 0..1, 0 is left, 1 is right), NAN if unknown"]
8014 pub rec_bottom_x: f32,
8015 #[doc = "Current tracked rectangle bottom y value if CAMERA_TRACKING_MODE_RECTANGLE (normalized 0..1, 0 is top, 1 is bottom), NAN if unknown"]
8016 pub rec_bottom_y: f32,
8017 #[doc = "Current tracking status"]
8018 pub tracking_status: CameraTrackingStatusFlags,
8019 #[doc = "Current tracking mode"]
8020 pub tracking_mode: CameraTrackingMode,
8021 #[doc = "Defines location of target data"]
8022 pub target_data: CameraTrackingTargetData,
8023 #[doc = "Camera id of a non-MAVLink camera attached to an autopilot (1-6). 0 if the component is a MAVLink camera (with its own component id)."]
8024 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
8025 pub camera_device_id: u8,
8026}
8027impl CAMERA_TRACKING_IMAGE_STATUS_DATA {
8028 pub const ENCODED_LEN: usize = 32usize;
8029 pub const DEFAULT: Self = Self {
8030 point_x: 0.0_f32,
8031 point_y: 0.0_f32,
8032 radius: 0.0_f32,
8033 rec_top_x: 0.0_f32,
8034 rec_top_y: 0.0_f32,
8035 rec_bottom_x: 0.0_f32,
8036 rec_bottom_y: 0.0_f32,
8037 tracking_status: CameraTrackingStatusFlags::DEFAULT,
8038 tracking_mode: CameraTrackingMode::DEFAULT,
8039 target_data: CameraTrackingTargetData::DEFAULT,
8040 camera_device_id: 0_u8,
8041 };
8042 #[cfg(feature = "arbitrary")]
8043 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
8044 use arbitrary::{Arbitrary, Unstructured};
8045 let mut buf = [0u8; 1024];
8046 rng.fill_bytes(&mut buf);
8047 let mut unstructured = Unstructured::new(&buf);
8048 Self::arbitrary(&mut unstructured).unwrap_or_default()
8049 }
8050}
8051impl Default for CAMERA_TRACKING_IMAGE_STATUS_DATA {
8052 fn default() -> Self {
8053 Self::DEFAULT.clone()
8054 }
8055}
8056impl MessageData for CAMERA_TRACKING_IMAGE_STATUS_DATA {
8057 type Message = MavMessage;
8058 const ID: u32 = 275u32;
8059 const NAME: &'static str = "CAMERA_TRACKING_IMAGE_STATUS";
8060 const EXTRA_CRC: u8 = 126u8;
8061 const ENCODED_LEN: usize = 32usize;
8062 fn deser(
8063 _version: MavlinkVersion,
8064 __input: &[u8],
8065 ) -> Result<Self, ::mavlink_core::error::ParserError> {
8066 let avail_len = __input.len();
8067 let mut payload_buf = [0; Self::ENCODED_LEN];
8068 let mut buf = if avail_len < Self::ENCODED_LEN {
8069 payload_buf[0..avail_len].copy_from_slice(__input);
8070 Bytes::new(&payload_buf)
8071 } else {
8072 Bytes::new(__input)
8073 };
8074 let mut __struct = Self::default();
8075 __struct.point_x = buf.get_f32_le();
8076 __struct.point_y = buf.get_f32_le();
8077 __struct.radius = buf.get_f32_le();
8078 __struct.rec_top_x = buf.get_f32_le();
8079 __struct.rec_top_y = buf.get_f32_le();
8080 __struct.rec_bottom_x = buf.get_f32_le();
8081 __struct.rec_bottom_y = buf.get_f32_le();
8082 let tmp = buf.get_u8();
8083 __struct.tracking_status =
8084 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
8085 enum_type: "CameraTrackingStatusFlags",
8086 value: tmp as u32,
8087 })?;
8088 let tmp = buf.get_u8();
8089 __struct.tracking_mode =
8090 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
8091 enum_type: "CameraTrackingMode",
8092 value: tmp as u32,
8093 })?;
8094 let tmp = buf.get_u8();
8095 __struct.target_data =
8096 CameraTrackingTargetData::from_bits(tmp & CameraTrackingTargetData::all().bits())
8097 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
8098 flag_type: "CameraTrackingTargetData",
8099 value: tmp as u32,
8100 })?;
8101 __struct.camera_device_id = buf.get_u8();
8102 Ok(__struct)
8103 }
8104 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
8105 let mut __tmp = BytesMut::new(bytes);
8106 #[allow(clippy::absurd_extreme_comparisons)]
8107 #[allow(unused_comparisons)]
8108 if __tmp.remaining() < Self::ENCODED_LEN {
8109 panic!(
8110 "buffer is too small (need {} bytes, but got {})",
8111 Self::ENCODED_LEN,
8112 __tmp.remaining(),
8113 )
8114 }
8115 __tmp.put_f32_le(self.point_x);
8116 __tmp.put_f32_le(self.point_y);
8117 __tmp.put_f32_le(self.radius);
8118 __tmp.put_f32_le(self.rec_top_x);
8119 __tmp.put_f32_le(self.rec_top_y);
8120 __tmp.put_f32_le(self.rec_bottom_x);
8121 __tmp.put_f32_le(self.rec_bottom_y);
8122 __tmp.put_u8(self.tracking_status as u8);
8123 __tmp.put_u8(self.tracking_mode as u8);
8124 __tmp.put_u8(self.target_data.bits());
8125 if matches!(version, MavlinkVersion::V2) {
8126 __tmp.put_u8(self.camera_device_id);
8127 let len = __tmp.len();
8128 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
8129 } else {
8130 __tmp.len()
8131 }
8132 }
8133}
8134#[doc = "Camera-IMU triggering and synchronisation message."]
8135#[doc = ""]
8136#[doc = "ID: 112"]
8137#[derive(Debug, Clone, PartialEq)]
8138#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
8139#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
8140pub struct CAMERA_TRIGGER_DATA {
8141 #[doc = "Timestamp for image frame (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
8142 pub time_usec: u64,
8143 #[doc = "Image frame sequence"]
8144 pub seq: u32,
8145}
8146impl CAMERA_TRIGGER_DATA {
8147 pub const ENCODED_LEN: usize = 12usize;
8148 pub const DEFAULT: Self = Self {
8149 time_usec: 0_u64,
8150 seq: 0_u32,
8151 };
8152 #[cfg(feature = "arbitrary")]
8153 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
8154 use arbitrary::{Arbitrary, Unstructured};
8155 let mut buf = [0u8; 1024];
8156 rng.fill_bytes(&mut buf);
8157 let mut unstructured = Unstructured::new(&buf);
8158 Self::arbitrary(&mut unstructured).unwrap_or_default()
8159 }
8160}
8161impl Default for CAMERA_TRIGGER_DATA {
8162 fn default() -> Self {
8163 Self::DEFAULT.clone()
8164 }
8165}
8166impl MessageData for CAMERA_TRIGGER_DATA {
8167 type Message = MavMessage;
8168 const ID: u32 = 112u32;
8169 const NAME: &'static str = "CAMERA_TRIGGER";
8170 const EXTRA_CRC: u8 = 174u8;
8171 const ENCODED_LEN: usize = 12usize;
8172 fn deser(
8173 _version: MavlinkVersion,
8174 __input: &[u8],
8175 ) -> Result<Self, ::mavlink_core::error::ParserError> {
8176 let avail_len = __input.len();
8177 let mut payload_buf = [0; Self::ENCODED_LEN];
8178 let mut buf = if avail_len < Self::ENCODED_LEN {
8179 payload_buf[0..avail_len].copy_from_slice(__input);
8180 Bytes::new(&payload_buf)
8181 } else {
8182 Bytes::new(__input)
8183 };
8184 let mut __struct = Self::default();
8185 __struct.time_usec = buf.get_u64_le();
8186 __struct.seq = buf.get_u32_le();
8187 Ok(__struct)
8188 }
8189 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
8190 let mut __tmp = BytesMut::new(bytes);
8191 #[allow(clippy::absurd_extreme_comparisons)]
8192 #[allow(unused_comparisons)]
8193 if __tmp.remaining() < Self::ENCODED_LEN {
8194 panic!(
8195 "buffer is too small (need {} bytes, but got {})",
8196 Self::ENCODED_LEN,
8197 __tmp.remaining(),
8198 )
8199 }
8200 __tmp.put_u64_le(self.time_usec);
8201 __tmp.put_u32_le(self.seq);
8202 if matches!(version, MavlinkVersion::V2) {
8203 let len = __tmp.len();
8204 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
8205 } else {
8206 __tmp.len()
8207 }
8208 }
8209}
8210#[doc = "A forwarded CANFD frame as requested by MAV_CMD_CAN_FORWARD. These are separated from CAN_FRAME as they need different handling (eg. TAO handling)."]
8211#[doc = ""]
8212#[doc = "ID: 387"]
8213#[derive(Debug, Clone, PartialEq)]
8214#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
8215#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
8216pub struct CANFD_FRAME_DATA {
8217 #[doc = "Frame ID"]
8218 pub id: u32,
8219 #[doc = "System ID."]
8220 pub target_system: u8,
8221 #[doc = "Component ID."]
8222 pub target_component: u8,
8223 #[doc = "bus number"]
8224 pub bus: u8,
8225 #[doc = "Frame length"]
8226 pub len: u8,
8227 #[doc = "Frame data"]
8228 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
8229 pub data: [u8; 64],
8230}
8231impl CANFD_FRAME_DATA {
8232 pub const ENCODED_LEN: usize = 72usize;
8233 pub const DEFAULT: Self = Self {
8234 id: 0_u32,
8235 target_system: 0_u8,
8236 target_component: 0_u8,
8237 bus: 0_u8,
8238 len: 0_u8,
8239 data: [0_u8; 64usize],
8240 };
8241 #[cfg(feature = "arbitrary")]
8242 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
8243 use arbitrary::{Arbitrary, Unstructured};
8244 let mut buf = [0u8; 1024];
8245 rng.fill_bytes(&mut buf);
8246 let mut unstructured = Unstructured::new(&buf);
8247 Self::arbitrary(&mut unstructured).unwrap_or_default()
8248 }
8249}
8250impl Default for CANFD_FRAME_DATA {
8251 fn default() -> Self {
8252 Self::DEFAULT.clone()
8253 }
8254}
8255impl MessageData for CANFD_FRAME_DATA {
8256 type Message = MavMessage;
8257 const ID: u32 = 387u32;
8258 const NAME: &'static str = "CANFD_FRAME";
8259 const EXTRA_CRC: u8 = 4u8;
8260 const ENCODED_LEN: usize = 72usize;
8261 fn deser(
8262 _version: MavlinkVersion,
8263 __input: &[u8],
8264 ) -> Result<Self, ::mavlink_core::error::ParserError> {
8265 let avail_len = __input.len();
8266 let mut payload_buf = [0; Self::ENCODED_LEN];
8267 let mut buf = if avail_len < Self::ENCODED_LEN {
8268 payload_buf[0..avail_len].copy_from_slice(__input);
8269 Bytes::new(&payload_buf)
8270 } else {
8271 Bytes::new(__input)
8272 };
8273 let mut __struct = Self::default();
8274 __struct.id = buf.get_u32_le();
8275 __struct.target_system = buf.get_u8();
8276 __struct.target_component = buf.get_u8();
8277 __struct.bus = buf.get_u8();
8278 __struct.len = buf.get_u8();
8279 for v in &mut __struct.data {
8280 let val = buf.get_u8();
8281 *v = val;
8282 }
8283 Ok(__struct)
8284 }
8285 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
8286 let mut __tmp = BytesMut::new(bytes);
8287 #[allow(clippy::absurd_extreme_comparisons)]
8288 #[allow(unused_comparisons)]
8289 if __tmp.remaining() < Self::ENCODED_LEN {
8290 panic!(
8291 "buffer is too small (need {} bytes, but got {})",
8292 Self::ENCODED_LEN,
8293 __tmp.remaining(),
8294 )
8295 }
8296 __tmp.put_u32_le(self.id);
8297 __tmp.put_u8(self.target_system);
8298 __tmp.put_u8(self.target_component);
8299 __tmp.put_u8(self.bus);
8300 __tmp.put_u8(self.len);
8301 for val in &self.data {
8302 __tmp.put_u8(*val);
8303 }
8304 if matches!(version, MavlinkVersion::V2) {
8305 let len = __tmp.len();
8306 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
8307 } else {
8308 __tmp.len()
8309 }
8310 }
8311}
8312#[doc = "Modify the filter of what CAN messages to forward over the mavlink. This can be used to make CAN forwarding work well on low bandwidth links. The filtering is applied on bits 8 to 24 of the CAN id (2nd and 3rd bytes) which corresponds to the DroneCAN message ID for DroneCAN. Filters with more than 16 IDs can be constructed by sending multiple CAN_FILTER_MODIFY messages."]
8313#[doc = ""]
8314#[doc = "ID: 388"]
8315#[derive(Debug, Clone, PartialEq)]
8316#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
8317#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
8318pub struct CAN_FILTER_MODIFY_DATA {
8319 #[doc = "filter IDs, length num_ids"]
8320 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
8321 pub ids: [u16; 16],
8322 #[doc = "System ID."]
8323 pub target_system: u8,
8324 #[doc = "Component ID."]
8325 pub target_component: u8,
8326 #[doc = "bus number"]
8327 pub bus: u8,
8328 #[doc = "what operation to perform on the filter list. See CAN_FILTER_OP enum."]
8329 pub operation: CanFilterOp,
8330 #[doc = "number of IDs in filter list"]
8331 pub num_ids: u8,
8332}
8333impl CAN_FILTER_MODIFY_DATA {
8334 pub const ENCODED_LEN: usize = 37usize;
8335 pub const DEFAULT: Self = Self {
8336 ids: [0_u16; 16usize],
8337 target_system: 0_u8,
8338 target_component: 0_u8,
8339 bus: 0_u8,
8340 operation: CanFilterOp::DEFAULT,
8341 num_ids: 0_u8,
8342 };
8343 #[cfg(feature = "arbitrary")]
8344 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
8345 use arbitrary::{Arbitrary, Unstructured};
8346 let mut buf = [0u8; 1024];
8347 rng.fill_bytes(&mut buf);
8348 let mut unstructured = Unstructured::new(&buf);
8349 Self::arbitrary(&mut unstructured).unwrap_or_default()
8350 }
8351}
8352impl Default for CAN_FILTER_MODIFY_DATA {
8353 fn default() -> Self {
8354 Self::DEFAULT.clone()
8355 }
8356}
8357impl MessageData for CAN_FILTER_MODIFY_DATA {
8358 type Message = MavMessage;
8359 const ID: u32 = 388u32;
8360 const NAME: &'static str = "CAN_FILTER_MODIFY";
8361 const EXTRA_CRC: u8 = 8u8;
8362 const ENCODED_LEN: usize = 37usize;
8363 fn deser(
8364 _version: MavlinkVersion,
8365 __input: &[u8],
8366 ) -> Result<Self, ::mavlink_core::error::ParserError> {
8367 let avail_len = __input.len();
8368 let mut payload_buf = [0; Self::ENCODED_LEN];
8369 let mut buf = if avail_len < Self::ENCODED_LEN {
8370 payload_buf[0..avail_len].copy_from_slice(__input);
8371 Bytes::new(&payload_buf)
8372 } else {
8373 Bytes::new(__input)
8374 };
8375 let mut __struct = Self::default();
8376 for v in &mut __struct.ids {
8377 let val = buf.get_u16_le();
8378 *v = val;
8379 }
8380 __struct.target_system = buf.get_u8();
8381 __struct.target_component = buf.get_u8();
8382 __struct.bus = buf.get_u8();
8383 let tmp = buf.get_u8();
8384 __struct.operation =
8385 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
8386 enum_type: "CanFilterOp",
8387 value: tmp as u32,
8388 })?;
8389 __struct.num_ids = buf.get_u8();
8390 Ok(__struct)
8391 }
8392 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
8393 let mut __tmp = BytesMut::new(bytes);
8394 #[allow(clippy::absurd_extreme_comparisons)]
8395 #[allow(unused_comparisons)]
8396 if __tmp.remaining() < Self::ENCODED_LEN {
8397 panic!(
8398 "buffer is too small (need {} bytes, but got {})",
8399 Self::ENCODED_LEN,
8400 __tmp.remaining(),
8401 )
8402 }
8403 for val in &self.ids {
8404 __tmp.put_u16_le(*val);
8405 }
8406 __tmp.put_u8(self.target_system);
8407 __tmp.put_u8(self.target_component);
8408 __tmp.put_u8(self.bus);
8409 __tmp.put_u8(self.operation as u8);
8410 __tmp.put_u8(self.num_ids);
8411 if matches!(version, MavlinkVersion::V2) {
8412 let len = __tmp.len();
8413 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
8414 } else {
8415 __tmp.len()
8416 }
8417 }
8418}
8419#[doc = "A forwarded CAN frame as requested by MAV_CMD_CAN_FORWARD."]
8420#[doc = ""]
8421#[doc = "ID: 386"]
8422#[derive(Debug, Clone, PartialEq)]
8423#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
8424#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
8425pub struct CAN_FRAME_DATA {
8426 #[doc = "Frame ID"]
8427 pub id: u32,
8428 #[doc = "System ID."]
8429 pub target_system: u8,
8430 #[doc = "Component ID."]
8431 pub target_component: u8,
8432 #[doc = "Bus number"]
8433 pub bus: u8,
8434 #[doc = "Frame length"]
8435 pub len: u8,
8436 #[doc = "Frame data"]
8437 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
8438 pub data: [u8; 8],
8439}
8440impl CAN_FRAME_DATA {
8441 pub const ENCODED_LEN: usize = 16usize;
8442 pub const DEFAULT: Self = Self {
8443 id: 0_u32,
8444 target_system: 0_u8,
8445 target_component: 0_u8,
8446 bus: 0_u8,
8447 len: 0_u8,
8448 data: [0_u8; 8usize],
8449 };
8450 #[cfg(feature = "arbitrary")]
8451 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
8452 use arbitrary::{Arbitrary, Unstructured};
8453 let mut buf = [0u8; 1024];
8454 rng.fill_bytes(&mut buf);
8455 let mut unstructured = Unstructured::new(&buf);
8456 Self::arbitrary(&mut unstructured).unwrap_or_default()
8457 }
8458}
8459impl Default for CAN_FRAME_DATA {
8460 fn default() -> Self {
8461 Self::DEFAULT.clone()
8462 }
8463}
8464impl MessageData for CAN_FRAME_DATA {
8465 type Message = MavMessage;
8466 const ID: u32 = 386u32;
8467 const NAME: &'static str = "CAN_FRAME";
8468 const EXTRA_CRC: u8 = 132u8;
8469 const ENCODED_LEN: usize = 16usize;
8470 fn deser(
8471 _version: MavlinkVersion,
8472 __input: &[u8],
8473 ) -> Result<Self, ::mavlink_core::error::ParserError> {
8474 let avail_len = __input.len();
8475 let mut payload_buf = [0; Self::ENCODED_LEN];
8476 let mut buf = if avail_len < Self::ENCODED_LEN {
8477 payload_buf[0..avail_len].copy_from_slice(__input);
8478 Bytes::new(&payload_buf)
8479 } else {
8480 Bytes::new(__input)
8481 };
8482 let mut __struct = Self::default();
8483 __struct.id = buf.get_u32_le();
8484 __struct.target_system = buf.get_u8();
8485 __struct.target_component = buf.get_u8();
8486 __struct.bus = buf.get_u8();
8487 __struct.len = buf.get_u8();
8488 for v in &mut __struct.data {
8489 let val = buf.get_u8();
8490 *v = val;
8491 }
8492 Ok(__struct)
8493 }
8494 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
8495 let mut __tmp = BytesMut::new(bytes);
8496 #[allow(clippy::absurd_extreme_comparisons)]
8497 #[allow(unused_comparisons)]
8498 if __tmp.remaining() < Self::ENCODED_LEN {
8499 panic!(
8500 "buffer is too small (need {} bytes, but got {})",
8501 Self::ENCODED_LEN,
8502 __tmp.remaining(),
8503 )
8504 }
8505 __tmp.put_u32_le(self.id);
8506 __tmp.put_u8(self.target_system);
8507 __tmp.put_u8(self.target_component);
8508 __tmp.put_u8(self.bus);
8509 __tmp.put_u8(self.len);
8510 for val in &self.data {
8511 __tmp.put_u8(*val);
8512 }
8513 if matches!(version, MavlinkVersion::V2) {
8514 let len = __tmp.len();
8515 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
8516 } else {
8517 __tmp.len()
8518 }
8519 }
8520}
8521#[doc = "Configure cellular modems. This message is re-emitted as an acknowledgement by the modem. The message may also be explicitly requested using MAV_CMD_REQUEST_MESSAGE."]
8522#[doc = ""]
8523#[doc = "ID: 336"]
8524#[derive(Debug, Clone, PartialEq)]
8525#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
8526#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
8527pub struct CELLULAR_CONFIG_DATA {
8528 #[doc = "Enable/disable LTE. 0: setting unchanged, 1: disabled, 2: enabled. Current setting when sent back as a response."]
8529 pub enable_lte: u8,
8530 #[doc = "Enable/disable PIN on the SIM card. 0: setting unchanged, 1: disabled, 2: enabled. Current setting when sent back as a response."]
8531 pub enable_pin: u8,
8532 #[doc = "PIN sent to the SIM card. Blank when PIN is disabled. Empty when message is sent back as a response."]
8533 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
8534 pub pin: [u8; 16],
8535 #[doc = "New PIN when changing the PIN. Blank to leave it unchanged. Empty when message is sent back as a response."]
8536 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
8537 pub new_pin: [u8; 16],
8538 #[doc = "Name of the cellular APN. Blank to leave it unchanged. Current APN when sent back as a response."]
8539 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
8540 pub apn: [u8; 32],
8541 #[doc = "Required PUK code in case the user failed to authenticate 3 times with the PIN. Empty when message is sent back as a response."]
8542 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
8543 pub puk: [u8; 16],
8544 #[doc = "Enable/disable roaming. 0: setting unchanged, 1: disabled, 2: enabled. Current setting when sent back as a response."]
8545 pub roaming: u8,
8546 #[doc = "Message acceptance response (sent back to GS)."]
8547 pub response: CellularConfigResponse,
8548}
8549impl CELLULAR_CONFIG_DATA {
8550 pub const ENCODED_LEN: usize = 84usize;
8551 pub const DEFAULT: Self = Self {
8552 enable_lte: 0_u8,
8553 enable_pin: 0_u8,
8554 pin: [0_u8; 16usize],
8555 new_pin: [0_u8; 16usize],
8556 apn: [0_u8; 32usize],
8557 puk: [0_u8; 16usize],
8558 roaming: 0_u8,
8559 response: CellularConfigResponse::DEFAULT,
8560 };
8561 #[cfg(feature = "arbitrary")]
8562 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
8563 use arbitrary::{Arbitrary, Unstructured};
8564 let mut buf = [0u8; 1024];
8565 rng.fill_bytes(&mut buf);
8566 let mut unstructured = Unstructured::new(&buf);
8567 Self::arbitrary(&mut unstructured).unwrap_or_default()
8568 }
8569}
8570impl Default for CELLULAR_CONFIG_DATA {
8571 fn default() -> Self {
8572 Self::DEFAULT.clone()
8573 }
8574}
8575impl MessageData for CELLULAR_CONFIG_DATA {
8576 type Message = MavMessage;
8577 const ID: u32 = 336u32;
8578 const NAME: &'static str = "CELLULAR_CONFIG";
8579 const EXTRA_CRC: u8 = 245u8;
8580 const ENCODED_LEN: usize = 84usize;
8581 fn deser(
8582 _version: MavlinkVersion,
8583 __input: &[u8],
8584 ) -> Result<Self, ::mavlink_core::error::ParserError> {
8585 let avail_len = __input.len();
8586 let mut payload_buf = [0; Self::ENCODED_LEN];
8587 let mut buf = if avail_len < Self::ENCODED_LEN {
8588 payload_buf[0..avail_len].copy_from_slice(__input);
8589 Bytes::new(&payload_buf)
8590 } else {
8591 Bytes::new(__input)
8592 };
8593 let mut __struct = Self::default();
8594 __struct.enable_lte = buf.get_u8();
8595 __struct.enable_pin = buf.get_u8();
8596 for v in &mut __struct.pin {
8597 let val = buf.get_u8();
8598 *v = val;
8599 }
8600 for v in &mut __struct.new_pin {
8601 let val = buf.get_u8();
8602 *v = val;
8603 }
8604 for v in &mut __struct.apn {
8605 let val = buf.get_u8();
8606 *v = val;
8607 }
8608 for v in &mut __struct.puk {
8609 let val = buf.get_u8();
8610 *v = val;
8611 }
8612 __struct.roaming = buf.get_u8();
8613 let tmp = buf.get_u8();
8614 __struct.response =
8615 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
8616 enum_type: "CellularConfigResponse",
8617 value: tmp as u32,
8618 })?;
8619 Ok(__struct)
8620 }
8621 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
8622 let mut __tmp = BytesMut::new(bytes);
8623 #[allow(clippy::absurd_extreme_comparisons)]
8624 #[allow(unused_comparisons)]
8625 if __tmp.remaining() < Self::ENCODED_LEN {
8626 panic!(
8627 "buffer is too small (need {} bytes, but got {})",
8628 Self::ENCODED_LEN,
8629 __tmp.remaining(),
8630 )
8631 }
8632 __tmp.put_u8(self.enable_lte);
8633 __tmp.put_u8(self.enable_pin);
8634 for val in &self.pin {
8635 __tmp.put_u8(*val);
8636 }
8637 for val in &self.new_pin {
8638 __tmp.put_u8(*val);
8639 }
8640 for val in &self.apn {
8641 __tmp.put_u8(*val);
8642 }
8643 for val in &self.puk {
8644 __tmp.put_u8(*val);
8645 }
8646 __tmp.put_u8(self.roaming);
8647 __tmp.put_u8(self.response as u8);
8648 if matches!(version, MavlinkVersion::V2) {
8649 let len = __tmp.len();
8650 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
8651 } else {
8652 __tmp.len()
8653 }
8654 }
8655}
8656#[doc = "Report current used cellular network status."]
8657#[doc = ""]
8658#[doc = "ID: 334"]
8659#[derive(Debug, Clone, PartialEq)]
8660#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
8661#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
8662pub struct CELLULAR_STATUS_DATA {
8663 #[doc = "Mobile country code. If unknown, set to UINT16_MAX"]
8664 pub mcc: u16,
8665 #[doc = "Mobile network code. If unknown, set to UINT16_MAX"]
8666 pub mnc: u16,
8667 #[doc = "Location area code. If unknown, set to 0"]
8668 pub lac: u16,
8669 #[doc = "Cellular modem status"]
8670 pub status: CellularStatusFlag,
8671 #[doc = "Failure reason when status in in CELLULAR_STATUS_FLAG_FAILED"]
8672 pub failure_reason: CellularNetworkFailedReason,
8673 #[doc = "Cellular network radio type: gsm, cdma, lte..."]
8674 pub mavtype: CellularNetworkRadioType,
8675 #[doc = "Signal quality in percent. If unknown, set to UINT8_MAX"]
8676 pub quality: u8,
8677}
8678impl CELLULAR_STATUS_DATA {
8679 pub const ENCODED_LEN: usize = 10usize;
8680 pub const DEFAULT: Self = Self {
8681 mcc: 0_u16,
8682 mnc: 0_u16,
8683 lac: 0_u16,
8684 status: CellularStatusFlag::DEFAULT,
8685 failure_reason: CellularNetworkFailedReason::DEFAULT,
8686 mavtype: CellularNetworkRadioType::DEFAULT,
8687 quality: 0_u8,
8688 };
8689 #[cfg(feature = "arbitrary")]
8690 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
8691 use arbitrary::{Arbitrary, Unstructured};
8692 let mut buf = [0u8; 1024];
8693 rng.fill_bytes(&mut buf);
8694 let mut unstructured = Unstructured::new(&buf);
8695 Self::arbitrary(&mut unstructured).unwrap_or_default()
8696 }
8697}
8698impl Default for CELLULAR_STATUS_DATA {
8699 fn default() -> Self {
8700 Self::DEFAULT.clone()
8701 }
8702}
8703impl MessageData for CELLULAR_STATUS_DATA {
8704 type Message = MavMessage;
8705 const ID: u32 = 334u32;
8706 const NAME: &'static str = "CELLULAR_STATUS";
8707 const EXTRA_CRC: u8 = 72u8;
8708 const ENCODED_LEN: usize = 10usize;
8709 fn deser(
8710 _version: MavlinkVersion,
8711 __input: &[u8],
8712 ) -> Result<Self, ::mavlink_core::error::ParserError> {
8713 let avail_len = __input.len();
8714 let mut payload_buf = [0; Self::ENCODED_LEN];
8715 let mut buf = if avail_len < Self::ENCODED_LEN {
8716 payload_buf[0..avail_len].copy_from_slice(__input);
8717 Bytes::new(&payload_buf)
8718 } else {
8719 Bytes::new(__input)
8720 };
8721 let mut __struct = Self::default();
8722 __struct.mcc = buf.get_u16_le();
8723 __struct.mnc = buf.get_u16_le();
8724 __struct.lac = buf.get_u16_le();
8725 let tmp = buf.get_u8();
8726 __struct.status =
8727 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
8728 enum_type: "CellularStatusFlag",
8729 value: tmp as u32,
8730 })?;
8731 let tmp = buf.get_u8();
8732 __struct.failure_reason =
8733 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
8734 enum_type: "CellularNetworkFailedReason",
8735 value: tmp as u32,
8736 })?;
8737 let tmp = buf.get_u8();
8738 __struct.mavtype =
8739 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
8740 enum_type: "CellularNetworkRadioType",
8741 value: tmp as u32,
8742 })?;
8743 __struct.quality = buf.get_u8();
8744 Ok(__struct)
8745 }
8746 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
8747 let mut __tmp = BytesMut::new(bytes);
8748 #[allow(clippy::absurd_extreme_comparisons)]
8749 #[allow(unused_comparisons)]
8750 if __tmp.remaining() < Self::ENCODED_LEN {
8751 panic!(
8752 "buffer is too small (need {} bytes, but got {})",
8753 Self::ENCODED_LEN,
8754 __tmp.remaining(),
8755 )
8756 }
8757 __tmp.put_u16_le(self.mcc);
8758 __tmp.put_u16_le(self.mnc);
8759 __tmp.put_u16_le(self.lac);
8760 __tmp.put_u8(self.status as u8);
8761 __tmp.put_u8(self.failure_reason as u8);
8762 __tmp.put_u8(self.mavtype as u8);
8763 __tmp.put_u8(self.quality);
8764 if matches!(version, MavlinkVersion::V2) {
8765 let len = __tmp.len();
8766 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
8767 } else {
8768 __tmp.len()
8769 }
8770 }
8771}
8772#[doc = "Request to control this MAV."]
8773#[doc = ""]
8774#[doc = "ID: 5"]
8775#[derive(Debug, Clone, PartialEq)]
8776#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
8777#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
8778pub struct CHANGE_OPERATOR_CONTROL_DATA {
8779 #[doc = "System the GCS requests control for"]
8780 pub target_system: u8,
8781 #[doc = "0: request control of this MAV, 1: Release control of this MAV"]
8782 pub control_request: u8,
8783 #[doc = "0: key as plaintext, 1-255: future, different hashing/encryption variants. The GCS should in general use the safest mode possible initially and then gradually move down the encryption level if it gets a NACK message indicating an encryption mismatch."]
8784 pub version: u8,
8785 #[doc = "Password / Key, depending on version plaintext or encrypted. 25 or less characters, NULL terminated. The characters may involve A-Z, a-z, 0-9, and \"!?,.-\""]
8786 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
8787 pub passkey: [u8; 25],
8788}
8789impl CHANGE_OPERATOR_CONTROL_DATA {
8790 pub const ENCODED_LEN: usize = 28usize;
8791 pub const DEFAULT: Self = Self {
8792 target_system: 0_u8,
8793 control_request: 0_u8,
8794 version: 0_u8,
8795 passkey: [0_u8; 25usize],
8796 };
8797 #[cfg(feature = "arbitrary")]
8798 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
8799 use arbitrary::{Arbitrary, Unstructured};
8800 let mut buf = [0u8; 1024];
8801 rng.fill_bytes(&mut buf);
8802 let mut unstructured = Unstructured::new(&buf);
8803 Self::arbitrary(&mut unstructured).unwrap_or_default()
8804 }
8805}
8806impl Default for CHANGE_OPERATOR_CONTROL_DATA {
8807 fn default() -> Self {
8808 Self::DEFAULT.clone()
8809 }
8810}
8811impl MessageData for CHANGE_OPERATOR_CONTROL_DATA {
8812 type Message = MavMessage;
8813 const ID: u32 = 5u32;
8814 const NAME: &'static str = "CHANGE_OPERATOR_CONTROL";
8815 const EXTRA_CRC: u8 = 217u8;
8816 const ENCODED_LEN: usize = 28usize;
8817 fn deser(
8818 _version: MavlinkVersion,
8819 __input: &[u8],
8820 ) -> Result<Self, ::mavlink_core::error::ParserError> {
8821 let avail_len = __input.len();
8822 let mut payload_buf = [0; Self::ENCODED_LEN];
8823 let mut buf = if avail_len < Self::ENCODED_LEN {
8824 payload_buf[0..avail_len].copy_from_slice(__input);
8825 Bytes::new(&payload_buf)
8826 } else {
8827 Bytes::new(__input)
8828 };
8829 let mut __struct = Self::default();
8830 __struct.target_system = buf.get_u8();
8831 __struct.control_request = buf.get_u8();
8832 __struct.version = buf.get_u8();
8833 for v in &mut __struct.passkey {
8834 let val = buf.get_u8();
8835 *v = val;
8836 }
8837 Ok(__struct)
8838 }
8839 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
8840 let mut __tmp = BytesMut::new(bytes);
8841 #[allow(clippy::absurd_extreme_comparisons)]
8842 #[allow(unused_comparisons)]
8843 if __tmp.remaining() < Self::ENCODED_LEN {
8844 panic!(
8845 "buffer is too small (need {} bytes, but got {})",
8846 Self::ENCODED_LEN,
8847 __tmp.remaining(),
8848 )
8849 }
8850 __tmp.put_u8(self.target_system);
8851 __tmp.put_u8(self.control_request);
8852 __tmp.put_u8(self.version);
8853 for val in &self.passkey {
8854 __tmp.put_u8(*val);
8855 }
8856 if matches!(version, MavlinkVersion::V2) {
8857 let len = __tmp.len();
8858 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
8859 } else {
8860 __tmp.len()
8861 }
8862 }
8863}
8864#[doc = "Accept / deny control of this MAV."]
8865#[doc = ""]
8866#[doc = "ID: 6"]
8867#[derive(Debug, Clone, PartialEq)]
8868#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
8869#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
8870pub struct CHANGE_OPERATOR_CONTROL_ACK_DATA {
8871 #[doc = "ID of the GCS this message"]
8872 pub gcs_system_id: u8,
8873 #[doc = "0: request control of this MAV, 1: Release control of this MAV"]
8874 pub control_request: u8,
8875 #[doc = "0: ACK, 1: NACK: Wrong passkey, 2: NACK: Unsupported passkey encryption method, 3: NACK: Already under control"]
8876 pub ack: u8,
8877}
8878impl CHANGE_OPERATOR_CONTROL_ACK_DATA {
8879 pub const ENCODED_LEN: usize = 3usize;
8880 pub const DEFAULT: Self = Self {
8881 gcs_system_id: 0_u8,
8882 control_request: 0_u8,
8883 ack: 0_u8,
8884 };
8885 #[cfg(feature = "arbitrary")]
8886 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
8887 use arbitrary::{Arbitrary, Unstructured};
8888 let mut buf = [0u8; 1024];
8889 rng.fill_bytes(&mut buf);
8890 let mut unstructured = Unstructured::new(&buf);
8891 Self::arbitrary(&mut unstructured).unwrap_or_default()
8892 }
8893}
8894impl Default for CHANGE_OPERATOR_CONTROL_ACK_DATA {
8895 fn default() -> Self {
8896 Self::DEFAULT.clone()
8897 }
8898}
8899impl MessageData for CHANGE_OPERATOR_CONTROL_ACK_DATA {
8900 type Message = MavMessage;
8901 const ID: u32 = 6u32;
8902 const NAME: &'static str = "CHANGE_OPERATOR_CONTROL_ACK";
8903 const EXTRA_CRC: u8 = 104u8;
8904 const ENCODED_LEN: usize = 3usize;
8905 fn deser(
8906 _version: MavlinkVersion,
8907 __input: &[u8],
8908 ) -> Result<Self, ::mavlink_core::error::ParserError> {
8909 let avail_len = __input.len();
8910 let mut payload_buf = [0; Self::ENCODED_LEN];
8911 let mut buf = if avail_len < Self::ENCODED_LEN {
8912 payload_buf[0..avail_len].copy_from_slice(__input);
8913 Bytes::new(&payload_buf)
8914 } else {
8915 Bytes::new(__input)
8916 };
8917 let mut __struct = Self::default();
8918 __struct.gcs_system_id = buf.get_u8();
8919 __struct.control_request = buf.get_u8();
8920 __struct.ack = buf.get_u8();
8921 Ok(__struct)
8922 }
8923 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
8924 let mut __tmp = BytesMut::new(bytes);
8925 #[allow(clippy::absurd_extreme_comparisons)]
8926 #[allow(unused_comparisons)]
8927 if __tmp.remaining() < Self::ENCODED_LEN {
8928 panic!(
8929 "buffer is too small (need {} bytes, but got {})",
8930 Self::ENCODED_LEN,
8931 __tmp.remaining(),
8932 )
8933 }
8934 __tmp.put_u8(self.gcs_system_id);
8935 __tmp.put_u8(self.control_request);
8936 __tmp.put_u8(self.ack);
8937 if matches!(version, MavlinkVersion::V2) {
8938 let len = __tmp.len();
8939 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
8940 } else {
8941 __tmp.len()
8942 }
8943 }
8944}
8945#[doc = "Information about a potential collision."]
8946#[doc = ""]
8947#[doc = "ID: 247"]
8948#[derive(Debug, Clone, PartialEq)]
8949#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
8950#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
8951pub struct COLLISION_DATA {
8952 #[doc = "Unique identifier, domain based on src field"]
8953 pub id: u32,
8954 #[doc = "Estimated time until collision occurs"]
8955 pub time_to_minimum_delta: f32,
8956 #[doc = "Closest vertical distance between vehicle and object"]
8957 pub altitude_minimum_delta: f32,
8958 #[doc = "Closest horizontal distance between vehicle and object"]
8959 pub horizontal_minimum_delta: f32,
8960 #[doc = "Collision data source"]
8961 pub src: MavCollisionSrc,
8962 #[doc = "Action that is being taken to avoid this collision"]
8963 pub action: MavCollisionAction,
8964 #[doc = "How concerned the aircraft is about this collision"]
8965 pub threat_level: MavCollisionThreatLevel,
8966}
8967impl COLLISION_DATA {
8968 pub const ENCODED_LEN: usize = 19usize;
8969 pub const DEFAULT: Self = Self {
8970 id: 0_u32,
8971 time_to_minimum_delta: 0.0_f32,
8972 altitude_minimum_delta: 0.0_f32,
8973 horizontal_minimum_delta: 0.0_f32,
8974 src: MavCollisionSrc::DEFAULT,
8975 action: MavCollisionAction::DEFAULT,
8976 threat_level: MavCollisionThreatLevel::DEFAULT,
8977 };
8978 #[cfg(feature = "arbitrary")]
8979 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
8980 use arbitrary::{Arbitrary, Unstructured};
8981 let mut buf = [0u8; 1024];
8982 rng.fill_bytes(&mut buf);
8983 let mut unstructured = Unstructured::new(&buf);
8984 Self::arbitrary(&mut unstructured).unwrap_or_default()
8985 }
8986}
8987impl Default for COLLISION_DATA {
8988 fn default() -> Self {
8989 Self::DEFAULT.clone()
8990 }
8991}
8992impl MessageData for COLLISION_DATA {
8993 type Message = MavMessage;
8994 const ID: u32 = 247u32;
8995 const NAME: &'static str = "COLLISION";
8996 const EXTRA_CRC: u8 = 81u8;
8997 const ENCODED_LEN: usize = 19usize;
8998 fn deser(
8999 _version: MavlinkVersion,
9000 __input: &[u8],
9001 ) -> Result<Self, ::mavlink_core::error::ParserError> {
9002 let avail_len = __input.len();
9003 let mut payload_buf = [0; Self::ENCODED_LEN];
9004 let mut buf = if avail_len < Self::ENCODED_LEN {
9005 payload_buf[0..avail_len].copy_from_slice(__input);
9006 Bytes::new(&payload_buf)
9007 } else {
9008 Bytes::new(__input)
9009 };
9010 let mut __struct = Self::default();
9011 __struct.id = buf.get_u32_le();
9012 __struct.time_to_minimum_delta = buf.get_f32_le();
9013 __struct.altitude_minimum_delta = buf.get_f32_le();
9014 __struct.horizontal_minimum_delta = buf.get_f32_le();
9015 let tmp = buf.get_u8();
9016 __struct.src =
9017 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
9018 enum_type: "MavCollisionSrc",
9019 value: tmp as u32,
9020 })?;
9021 let tmp = buf.get_u8();
9022 __struct.action =
9023 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
9024 enum_type: "MavCollisionAction",
9025 value: tmp as u32,
9026 })?;
9027 let tmp = buf.get_u8();
9028 __struct.threat_level =
9029 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
9030 enum_type: "MavCollisionThreatLevel",
9031 value: tmp as u32,
9032 })?;
9033 Ok(__struct)
9034 }
9035 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
9036 let mut __tmp = BytesMut::new(bytes);
9037 #[allow(clippy::absurd_extreme_comparisons)]
9038 #[allow(unused_comparisons)]
9039 if __tmp.remaining() < Self::ENCODED_LEN {
9040 panic!(
9041 "buffer is too small (need {} bytes, but got {})",
9042 Self::ENCODED_LEN,
9043 __tmp.remaining(),
9044 )
9045 }
9046 __tmp.put_u32_le(self.id);
9047 __tmp.put_f32_le(self.time_to_minimum_delta);
9048 __tmp.put_f32_le(self.altitude_minimum_delta);
9049 __tmp.put_f32_le(self.horizontal_minimum_delta);
9050 __tmp.put_u8(self.src as u8);
9051 __tmp.put_u8(self.action as u8);
9052 __tmp.put_u8(self.threat_level as u8);
9053 if matches!(version, MavlinkVersion::V2) {
9054 let len = __tmp.len();
9055 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
9056 } else {
9057 __tmp.len()
9058 }
9059 }
9060}
9061#[doc = "Report status of a command. Includes feedback whether the command was executed. The command microservice is documented at <https://mavlink.io/en/services/command.html>."]
9062#[doc = ""]
9063#[doc = "ID: 77"]
9064#[derive(Debug, Clone, PartialEq)]
9065#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
9066#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
9067pub struct COMMAND_ACK_DATA {
9068 #[doc = "Command ID (of acknowledged command)."]
9069 pub command: MavCmd,
9070 #[doc = "Result of command."]
9071 pub result: MavResult,
9072 #[doc = "The progress percentage when result is MAV_RESULT_IN_PROGRESS. Values: [0-100], or UINT8_MAX if the progress is unknown."]
9073 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
9074 pub progress: u8,
9075 #[doc = "Additional result information. Can be set with a command-specific enum containing command-specific error reasons for why the command might be denied. If used, the associated enum must be documented in the corresponding MAV_CMD (this enum should have a 0 value to indicate \"unused\" or \"unknown\")."]
9076 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
9077 pub result_param2: i32,
9078 #[doc = "System ID of the target recipient. This is the ID of the system that sent the command for which this COMMAND_ACK is an acknowledgement."]
9079 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
9080 pub target_system: u8,
9081 #[doc = "Component ID of the target recipient. This is the ID of the system that sent the command for which this COMMAND_ACK is an acknowledgement."]
9082 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
9083 pub target_component: u8,
9084}
9085impl COMMAND_ACK_DATA {
9086 pub const ENCODED_LEN: usize = 10usize;
9087 pub const DEFAULT: Self = Self {
9088 command: MavCmd::DEFAULT,
9089 result: MavResult::DEFAULT,
9090 progress: 0_u8,
9091 result_param2: 0_i32,
9092 target_system: 0_u8,
9093 target_component: 0_u8,
9094 };
9095 #[cfg(feature = "arbitrary")]
9096 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
9097 use arbitrary::{Arbitrary, Unstructured};
9098 let mut buf = [0u8; 1024];
9099 rng.fill_bytes(&mut buf);
9100 let mut unstructured = Unstructured::new(&buf);
9101 Self::arbitrary(&mut unstructured).unwrap_or_default()
9102 }
9103}
9104impl Default for COMMAND_ACK_DATA {
9105 fn default() -> Self {
9106 Self::DEFAULT.clone()
9107 }
9108}
9109impl MessageData for COMMAND_ACK_DATA {
9110 type Message = MavMessage;
9111 const ID: u32 = 77u32;
9112 const NAME: &'static str = "COMMAND_ACK";
9113 const EXTRA_CRC: u8 = 143u8;
9114 const ENCODED_LEN: usize = 10usize;
9115 fn deser(
9116 _version: MavlinkVersion,
9117 __input: &[u8],
9118 ) -> Result<Self, ::mavlink_core::error::ParserError> {
9119 let avail_len = __input.len();
9120 let mut payload_buf = [0; Self::ENCODED_LEN];
9121 let mut buf = if avail_len < Self::ENCODED_LEN {
9122 payload_buf[0..avail_len].copy_from_slice(__input);
9123 Bytes::new(&payload_buf)
9124 } else {
9125 Bytes::new(__input)
9126 };
9127 let mut __struct = Self::default();
9128 let tmp = buf.get_u16_le();
9129 __struct.command = FromPrimitive::from_u16(tmp).ok_or(
9130 ::mavlink_core::error::ParserError::InvalidEnum {
9131 enum_type: "MavCmd",
9132 value: tmp as u32,
9133 },
9134 )?;
9135 let tmp = buf.get_u8();
9136 __struct.result =
9137 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
9138 enum_type: "MavResult",
9139 value: tmp as u32,
9140 })?;
9141 __struct.progress = buf.get_u8();
9142 __struct.result_param2 = buf.get_i32_le();
9143 __struct.target_system = buf.get_u8();
9144 __struct.target_component = buf.get_u8();
9145 Ok(__struct)
9146 }
9147 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
9148 let mut __tmp = BytesMut::new(bytes);
9149 #[allow(clippy::absurd_extreme_comparisons)]
9150 #[allow(unused_comparisons)]
9151 if __tmp.remaining() < Self::ENCODED_LEN {
9152 panic!(
9153 "buffer is too small (need {} bytes, but got {})",
9154 Self::ENCODED_LEN,
9155 __tmp.remaining(),
9156 )
9157 }
9158 __tmp.put_u16_le(self.command as u16);
9159 __tmp.put_u8(self.result as u8);
9160 if matches!(version, MavlinkVersion::V2) {
9161 __tmp.put_u8(self.progress);
9162 __tmp.put_i32_le(self.result_param2);
9163 __tmp.put_u8(self.target_system);
9164 __tmp.put_u8(self.target_component);
9165 let len = __tmp.len();
9166 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
9167 } else {
9168 __tmp.len()
9169 }
9170 }
9171}
9172#[doc = "Cancel a long running command. The target system should respond with a COMMAND_ACK to the original command with result=MAV_RESULT_CANCELLED if the long running process was cancelled. If it has already completed, the cancel action can be ignored. The cancel action can be retried until some sort of acknowledgement to the original command has been received. The command microservice is documented at <https://mavlink.io/en/services/command.html>."]
9173#[doc = ""]
9174#[doc = "ID: 80"]
9175#[derive(Debug, Clone, PartialEq)]
9176#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
9177#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
9178pub struct COMMAND_CANCEL_DATA {
9179 #[doc = "Command ID (of command to cancel)."]
9180 pub command: MavCmd,
9181 #[doc = "System executing long running command. Should not be broadcast (0)."]
9182 pub target_system: u8,
9183 #[doc = "Component executing long running command."]
9184 pub target_component: u8,
9185}
9186impl COMMAND_CANCEL_DATA {
9187 pub const ENCODED_LEN: usize = 4usize;
9188 pub const DEFAULT: Self = Self {
9189 command: MavCmd::DEFAULT,
9190 target_system: 0_u8,
9191 target_component: 0_u8,
9192 };
9193 #[cfg(feature = "arbitrary")]
9194 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
9195 use arbitrary::{Arbitrary, Unstructured};
9196 let mut buf = [0u8; 1024];
9197 rng.fill_bytes(&mut buf);
9198 let mut unstructured = Unstructured::new(&buf);
9199 Self::arbitrary(&mut unstructured).unwrap_or_default()
9200 }
9201}
9202impl Default for COMMAND_CANCEL_DATA {
9203 fn default() -> Self {
9204 Self::DEFAULT.clone()
9205 }
9206}
9207impl MessageData for COMMAND_CANCEL_DATA {
9208 type Message = MavMessage;
9209 const ID: u32 = 80u32;
9210 const NAME: &'static str = "COMMAND_CANCEL";
9211 const EXTRA_CRC: u8 = 14u8;
9212 const ENCODED_LEN: usize = 4usize;
9213 fn deser(
9214 _version: MavlinkVersion,
9215 __input: &[u8],
9216 ) -> Result<Self, ::mavlink_core::error::ParserError> {
9217 let avail_len = __input.len();
9218 let mut payload_buf = [0; Self::ENCODED_LEN];
9219 let mut buf = if avail_len < Self::ENCODED_LEN {
9220 payload_buf[0..avail_len].copy_from_slice(__input);
9221 Bytes::new(&payload_buf)
9222 } else {
9223 Bytes::new(__input)
9224 };
9225 let mut __struct = Self::default();
9226 let tmp = buf.get_u16_le();
9227 __struct.command = FromPrimitive::from_u16(tmp).ok_or(
9228 ::mavlink_core::error::ParserError::InvalidEnum {
9229 enum_type: "MavCmd",
9230 value: tmp as u32,
9231 },
9232 )?;
9233 __struct.target_system = buf.get_u8();
9234 __struct.target_component = buf.get_u8();
9235 Ok(__struct)
9236 }
9237 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
9238 let mut __tmp = BytesMut::new(bytes);
9239 #[allow(clippy::absurd_extreme_comparisons)]
9240 #[allow(unused_comparisons)]
9241 if __tmp.remaining() < Self::ENCODED_LEN {
9242 panic!(
9243 "buffer is too small (need {} bytes, but got {})",
9244 Self::ENCODED_LEN,
9245 __tmp.remaining(),
9246 )
9247 }
9248 __tmp.put_u16_le(self.command as u16);
9249 __tmp.put_u8(self.target_system);
9250 __tmp.put_u8(self.target_component);
9251 if matches!(version, MavlinkVersion::V2) {
9252 let len = __tmp.len();
9253 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
9254 } else {
9255 __tmp.len()
9256 }
9257 }
9258}
9259#[doc = "Send a command with up to seven parameters to the MAV, where params 5 and 6 are integers and the other values are floats. This is preferred over COMMAND_LONG as it allows the MAV_FRAME to be specified for interpreting positional information, such as altitude. COMMAND_INT is also preferred when sending latitude and longitude data in params 5 and 6, as it allows for greater precision. Param 5 and 6 encode positional data as scaled integers, where the scaling depends on the actual command value. NaN or INT32_MAX may be used in float/integer params (respectively) to indicate optional/default values (e.g. to use the component's current latitude, yaw rather than a specific value). The command microservice is documented at <https://mavlink.io/en/services/command.html>."]
9260#[doc = ""]
9261#[doc = "ID: 75"]
9262#[derive(Debug, Clone, PartialEq)]
9263#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
9264#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
9265pub struct COMMAND_INT_DATA {
9266 #[doc = "PARAM1, see MAV_CMD enum"]
9267 pub param1: f32,
9268 #[doc = "PARAM2, see MAV_CMD enum"]
9269 pub param2: f32,
9270 #[doc = "PARAM3, see MAV_CMD enum"]
9271 pub param3: f32,
9272 #[doc = "PARAM4, see MAV_CMD enum"]
9273 pub param4: f32,
9274 #[doc = "PARAM5 / local: x position in meters * 1e4, global: latitude in degrees * 10^7"]
9275 pub x: i32,
9276 #[doc = "PARAM6 / local: y position in meters * 1e4, global: longitude in degrees * 10^7"]
9277 pub y: i32,
9278 #[doc = "PARAM7 / z position: global: altitude in meters (relative or absolute, depending on frame)."]
9279 pub z: f32,
9280 #[doc = "The scheduled action for the mission item."]
9281 pub command: MavCmd,
9282 #[doc = "System ID"]
9283 pub target_system: u8,
9284 #[doc = "Component ID"]
9285 pub target_component: u8,
9286 #[doc = "The coordinate system of the COMMAND."]
9287 pub frame: MavFrame,
9288 #[doc = "Not used."]
9289 pub current: u8,
9290 #[doc = "Not used (set 0)."]
9291 pub autocontinue: u8,
9292}
9293impl COMMAND_INT_DATA {
9294 pub const ENCODED_LEN: usize = 35usize;
9295 pub const DEFAULT: Self = Self {
9296 param1: 0.0_f32,
9297 param2: 0.0_f32,
9298 param3: 0.0_f32,
9299 param4: 0.0_f32,
9300 x: 0_i32,
9301 y: 0_i32,
9302 z: 0.0_f32,
9303 command: MavCmd::DEFAULT,
9304 target_system: 0_u8,
9305 target_component: 0_u8,
9306 frame: MavFrame::DEFAULT,
9307 current: 0_u8,
9308 autocontinue: 0_u8,
9309 };
9310 #[cfg(feature = "arbitrary")]
9311 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
9312 use arbitrary::{Arbitrary, Unstructured};
9313 let mut buf = [0u8; 1024];
9314 rng.fill_bytes(&mut buf);
9315 let mut unstructured = Unstructured::new(&buf);
9316 Self::arbitrary(&mut unstructured).unwrap_or_default()
9317 }
9318}
9319impl Default for COMMAND_INT_DATA {
9320 fn default() -> Self {
9321 Self::DEFAULT.clone()
9322 }
9323}
9324impl MessageData for COMMAND_INT_DATA {
9325 type Message = MavMessage;
9326 const ID: u32 = 75u32;
9327 const NAME: &'static str = "COMMAND_INT";
9328 const EXTRA_CRC: u8 = 158u8;
9329 const ENCODED_LEN: usize = 35usize;
9330 fn deser(
9331 _version: MavlinkVersion,
9332 __input: &[u8],
9333 ) -> Result<Self, ::mavlink_core::error::ParserError> {
9334 let avail_len = __input.len();
9335 let mut payload_buf = [0; Self::ENCODED_LEN];
9336 let mut buf = if avail_len < Self::ENCODED_LEN {
9337 payload_buf[0..avail_len].copy_from_slice(__input);
9338 Bytes::new(&payload_buf)
9339 } else {
9340 Bytes::new(__input)
9341 };
9342 let mut __struct = Self::default();
9343 __struct.param1 = buf.get_f32_le();
9344 __struct.param2 = buf.get_f32_le();
9345 __struct.param3 = buf.get_f32_le();
9346 __struct.param4 = buf.get_f32_le();
9347 __struct.x = buf.get_i32_le();
9348 __struct.y = buf.get_i32_le();
9349 __struct.z = buf.get_f32_le();
9350 let tmp = buf.get_u16_le();
9351 __struct.command = FromPrimitive::from_u16(tmp).ok_or(
9352 ::mavlink_core::error::ParserError::InvalidEnum {
9353 enum_type: "MavCmd",
9354 value: tmp as u32,
9355 },
9356 )?;
9357 __struct.target_system = buf.get_u8();
9358 __struct.target_component = buf.get_u8();
9359 let tmp = buf.get_u8();
9360 __struct.frame =
9361 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
9362 enum_type: "MavFrame",
9363 value: tmp as u32,
9364 })?;
9365 __struct.current = buf.get_u8();
9366 __struct.autocontinue = buf.get_u8();
9367 Ok(__struct)
9368 }
9369 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
9370 let mut __tmp = BytesMut::new(bytes);
9371 #[allow(clippy::absurd_extreme_comparisons)]
9372 #[allow(unused_comparisons)]
9373 if __tmp.remaining() < Self::ENCODED_LEN {
9374 panic!(
9375 "buffer is too small (need {} bytes, but got {})",
9376 Self::ENCODED_LEN,
9377 __tmp.remaining(),
9378 )
9379 }
9380 __tmp.put_f32_le(self.param1);
9381 __tmp.put_f32_le(self.param2);
9382 __tmp.put_f32_le(self.param3);
9383 __tmp.put_f32_le(self.param4);
9384 __tmp.put_i32_le(self.x);
9385 __tmp.put_i32_le(self.y);
9386 __tmp.put_f32_le(self.z);
9387 __tmp.put_u16_le(self.command as u16);
9388 __tmp.put_u8(self.target_system);
9389 __tmp.put_u8(self.target_component);
9390 __tmp.put_u8(self.frame as u8);
9391 __tmp.put_u8(self.current);
9392 __tmp.put_u8(self.autocontinue);
9393 if matches!(version, MavlinkVersion::V2) {
9394 let len = __tmp.len();
9395 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
9396 } else {
9397 __tmp.len()
9398 }
9399 }
9400}
9401#[doc = "Send a command with up to seven parameters to the MAV. COMMAND_INT is generally preferred when sending MAV_CMD commands that include positional information; it offers higher precision and allows the MAV_FRAME to be specified (which may otherwise be ambiguous, particularly for altitude). The command microservice is documented at <https://mavlink.io/en/services/command.html>."]
9402#[doc = ""]
9403#[doc = "ID: 76"]
9404#[derive(Debug, Clone, PartialEq)]
9405#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
9406#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
9407pub struct COMMAND_LONG_DATA {
9408 #[doc = "Parameter 1 (for the specific command)."]
9409 pub param1: f32,
9410 #[doc = "Parameter 2 (for the specific command)."]
9411 pub param2: f32,
9412 #[doc = "Parameter 3 (for the specific command)."]
9413 pub param3: f32,
9414 #[doc = "Parameter 4 (for the specific command)."]
9415 pub param4: f32,
9416 #[doc = "Parameter 5 (for the specific command)."]
9417 pub param5: f32,
9418 #[doc = "Parameter 6 (for the specific command)."]
9419 pub param6: f32,
9420 #[doc = "Parameter 7 (for the specific command)."]
9421 pub param7: f32,
9422 #[doc = "Command ID (of command to send)."]
9423 pub command: MavCmd,
9424 #[doc = "System which should execute the command"]
9425 pub target_system: u8,
9426 #[doc = "Component which should execute the command, 0 for all components"]
9427 pub target_component: u8,
9428 #[doc = "0: First transmission of this command. 1-255: Confirmation transmissions (e.g. for kill command)"]
9429 pub confirmation: u8,
9430}
9431impl COMMAND_LONG_DATA {
9432 pub const ENCODED_LEN: usize = 33usize;
9433 pub const DEFAULT: Self = Self {
9434 param1: 0.0_f32,
9435 param2: 0.0_f32,
9436 param3: 0.0_f32,
9437 param4: 0.0_f32,
9438 param5: 0.0_f32,
9439 param6: 0.0_f32,
9440 param7: 0.0_f32,
9441 command: MavCmd::DEFAULT,
9442 target_system: 0_u8,
9443 target_component: 0_u8,
9444 confirmation: 0_u8,
9445 };
9446 #[cfg(feature = "arbitrary")]
9447 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
9448 use arbitrary::{Arbitrary, Unstructured};
9449 let mut buf = [0u8; 1024];
9450 rng.fill_bytes(&mut buf);
9451 let mut unstructured = Unstructured::new(&buf);
9452 Self::arbitrary(&mut unstructured).unwrap_or_default()
9453 }
9454}
9455impl Default for COMMAND_LONG_DATA {
9456 fn default() -> Self {
9457 Self::DEFAULT.clone()
9458 }
9459}
9460impl MessageData for COMMAND_LONG_DATA {
9461 type Message = MavMessage;
9462 const ID: u32 = 76u32;
9463 const NAME: &'static str = "COMMAND_LONG";
9464 const EXTRA_CRC: u8 = 152u8;
9465 const ENCODED_LEN: usize = 33usize;
9466 fn deser(
9467 _version: MavlinkVersion,
9468 __input: &[u8],
9469 ) -> Result<Self, ::mavlink_core::error::ParserError> {
9470 let avail_len = __input.len();
9471 let mut payload_buf = [0; Self::ENCODED_LEN];
9472 let mut buf = if avail_len < Self::ENCODED_LEN {
9473 payload_buf[0..avail_len].copy_from_slice(__input);
9474 Bytes::new(&payload_buf)
9475 } else {
9476 Bytes::new(__input)
9477 };
9478 let mut __struct = Self::default();
9479 __struct.param1 = buf.get_f32_le();
9480 __struct.param2 = buf.get_f32_le();
9481 __struct.param3 = buf.get_f32_le();
9482 __struct.param4 = buf.get_f32_le();
9483 __struct.param5 = buf.get_f32_le();
9484 __struct.param6 = buf.get_f32_le();
9485 __struct.param7 = buf.get_f32_le();
9486 let tmp = buf.get_u16_le();
9487 __struct.command = FromPrimitive::from_u16(tmp).ok_or(
9488 ::mavlink_core::error::ParserError::InvalidEnum {
9489 enum_type: "MavCmd",
9490 value: tmp as u32,
9491 },
9492 )?;
9493 __struct.target_system = buf.get_u8();
9494 __struct.target_component = buf.get_u8();
9495 __struct.confirmation = buf.get_u8();
9496 Ok(__struct)
9497 }
9498 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
9499 let mut __tmp = BytesMut::new(bytes);
9500 #[allow(clippy::absurd_extreme_comparisons)]
9501 #[allow(unused_comparisons)]
9502 if __tmp.remaining() < Self::ENCODED_LEN {
9503 panic!(
9504 "buffer is too small (need {} bytes, but got {})",
9505 Self::ENCODED_LEN,
9506 __tmp.remaining(),
9507 )
9508 }
9509 __tmp.put_f32_le(self.param1);
9510 __tmp.put_f32_le(self.param2);
9511 __tmp.put_f32_le(self.param3);
9512 __tmp.put_f32_le(self.param4);
9513 __tmp.put_f32_le(self.param5);
9514 __tmp.put_f32_le(self.param6);
9515 __tmp.put_f32_le(self.param7);
9516 __tmp.put_u16_le(self.command as u16);
9517 __tmp.put_u8(self.target_system);
9518 __tmp.put_u8(self.target_component);
9519 __tmp.put_u8(self.confirmation);
9520 if matches!(version, MavlinkVersion::V2) {
9521 let len = __tmp.len();
9522 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
9523 } else {
9524 __tmp.len()
9525 }
9526 }
9527}
9528#[deprecated = " See `COMPONENT_METADATA` (Deprecated since 2022-04)"]
9529#[doc = "Component information message, which may be requested using MAV_CMD_REQUEST_MESSAGE."]
9530#[doc = ""]
9531#[doc = "ID: 395"]
9532#[derive(Debug, Clone, PartialEq)]
9533#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
9534#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
9535pub struct COMPONENT_INFORMATION_DATA {
9536 #[doc = "Timestamp (time since system boot)."]
9537 pub time_boot_ms: u32,
9538 #[doc = "CRC32 of the general metadata file (general_metadata_uri)."]
9539 pub general_metadata_file_crc: u32,
9540 #[doc = "CRC32 of peripherals metadata file (peripherals_metadata_uri)."]
9541 pub peripherals_metadata_file_crc: u32,
9542 #[doc = "MAVLink FTP URI for the general metadata file (COMP_METADATA_TYPE_GENERAL), which may be compressed with xz. The file contains general component metadata, and may contain URI links for additional metadata (see COMP_METADATA_TYPE). The information is static from boot, and may be generated at compile time. The string needs to be zero terminated."]
9543 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
9544 pub general_metadata_uri: [u8; 100],
9545 #[doc = "(Optional) MAVLink FTP URI for the peripherals metadata file (COMP_METADATA_TYPE_PERIPHERALS), which may be compressed with xz. This contains data about \"attached components\" such as UAVCAN nodes. The peripherals are in a separate file because the information must be generated dynamically at runtime. The string needs to be zero terminated."]
9546 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
9547 pub peripherals_metadata_uri: [u8; 100],
9548}
9549impl COMPONENT_INFORMATION_DATA {
9550 pub const ENCODED_LEN: usize = 212usize;
9551 pub const DEFAULT: Self = Self {
9552 time_boot_ms: 0_u32,
9553 general_metadata_file_crc: 0_u32,
9554 peripherals_metadata_file_crc: 0_u32,
9555 general_metadata_uri: [0_u8; 100usize],
9556 peripherals_metadata_uri: [0_u8; 100usize],
9557 };
9558 #[cfg(feature = "arbitrary")]
9559 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
9560 use arbitrary::{Arbitrary, Unstructured};
9561 let mut buf = [0u8; 1024];
9562 rng.fill_bytes(&mut buf);
9563 let mut unstructured = Unstructured::new(&buf);
9564 Self::arbitrary(&mut unstructured).unwrap_or_default()
9565 }
9566}
9567impl Default for COMPONENT_INFORMATION_DATA {
9568 fn default() -> Self {
9569 Self::DEFAULT.clone()
9570 }
9571}
9572impl MessageData for COMPONENT_INFORMATION_DATA {
9573 type Message = MavMessage;
9574 const ID: u32 = 395u32;
9575 const NAME: &'static str = "COMPONENT_INFORMATION";
9576 const EXTRA_CRC: u8 = 0u8;
9577 const ENCODED_LEN: usize = 212usize;
9578 fn deser(
9579 _version: MavlinkVersion,
9580 __input: &[u8],
9581 ) -> Result<Self, ::mavlink_core::error::ParserError> {
9582 let avail_len = __input.len();
9583 let mut payload_buf = [0; Self::ENCODED_LEN];
9584 let mut buf = if avail_len < Self::ENCODED_LEN {
9585 payload_buf[0..avail_len].copy_from_slice(__input);
9586 Bytes::new(&payload_buf)
9587 } else {
9588 Bytes::new(__input)
9589 };
9590 let mut __struct = Self::default();
9591 __struct.time_boot_ms = buf.get_u32_le();
9592 __struct.general_metadata_file_crc = buf.get_u32_le();
9593 __struct.peripherals_metadata_file_crc = buf.get_u32_le();
9594 for v in &mut __struct.general_metadata_uri {
9595 let val = buf.get_u8();
9596 *v = val;
9597 }
9598 for v in &mut __struct.peripherals_metadata_uri {
9599 let val = buf.get_u8();
9600 *v = val;
9601 }
9602 Ok(__struct)
9603 }
9604 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
9605 let mut __tmp = BytesMut::new(bytes);
9606 #[allow(clippy::absurd_extreme_comparisons)]
9607 #[allow(unused_comparisons)]
9608 if __tmp.remaining() < Self::ENCODED_LEN {
9609 panic!(
9610 "buffer is too small (need {} bytes, but got {})",
9611 Self::ENCODED_LEN,
9612 __tmp.remaining(),
9613 )
9614 }
9615 __tmp.put_u32_le(self.time_boot_ms);
9616 __tmp.put_u32_le(self.general_metadata_file_crc);
9617 __tmp.put_u32_le(self.peripherals_metadata_file_crc);
9618 for val in &self.general_metadata_uri {
9619 __tmp.put_u8(*val);
9620 }
9621 for val in &self.peripherals_metadata_uri {
9622 __tmp.put_u8(*val);
9623 }
9624 if matches!(version, MavlinkVersion::V2) {
9625 let len = __tmp.len();
9626 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
9627 } else {
9628 __tmp.len()
9629 }
9630 }
9631}
9632#[doc = "Basic component information data. Should be requested using MAV_CMD_REQUEST_MESSAGE on startup, or when required."]
9633#[doc = ""]
9634#[doc = "ID: 396"]
9635#[derive(Debug, Clone, PartialEq)]
9636#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
9637#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
9638pub struct COMPONENT_INFORMATION_BASIC_DATA {
9639 #[doc = "Component capability flags"]
9640 pub capabilities: MavProtocolCapability,
9641 #[doc = "Timestamp (time since system boot)."]
9642 pub time_boot_ms: u32,
9643 #[doc = "Date of manufacture as a UNIX Epoch time (since 1.1.1970) in seconds."]
9644 pub time_manufacture_s: u32,
9645 #[doc = "Name of the component vendor. Needs to be zero terminated. The field is optional and can be empty/all zeros."]
9646 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
9647 pub vendor_name: [u8; 32],
9648 #[doc = "Name of the component model. Needs to be zero terminated. The field is optional and can be empty/all zeros."]
9649 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
9650 pub model_name: [u8; 32],
9651 #[doc = "Software version. The recommended format is SEMVER: 'major.minor.patch' (any format may be used). The field must be zero terminated if it has a value. The field is optional and can be empty/all zeros."]
9652 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
9653 pub software_version: [u8; 24],
9654 #[doc = "Hardware version. The recommended format is SEMVER: 'major.minor.patch' (any format may be used). The field must be zero terminated if it has a value. The field is optional and can be empty/all zeros."]
9655 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
9656 pub hardware_version: [u8; 24],
9657 #[doc = "Hardware serial number. The field must be zero terminated if it has a value. The field is optional and can be empty/all zeros."]
9658 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
9659 pub serial_number: [u8; 32],
9660}
9661impl COMPONENT_INFORMATION_BASIC_DATA {
9662 pub const ENCODED_LEN: usize = 160usize;
9663 pub const DEFAULT: Self = Self {
9664 capabilities: MavProtocolCapability::DEFAULT,
9665 time_boot_ms: 0_u32,
9666 time_manufacture_s: 0_u32,
9667 vendor_name: [0_u8; 32usize],
9668 model_name: [0_u8; 32usize],
9669 software_version: [0_u8; 24usize],
9670 hardware_version: [0_u8; 24usize],
9671 serial_number: [0_u8; 32usize],
9672 };
9673 #[cfg(feature = "arbitrary")]
9674 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
9675 use arbitrary::{Arbitrary, Unstructured};
9676 let mut buf = [0u8; 1024];
9677 rng.fill_bytes(&mut buf);
9678 let mut unstructured = Unstructured::new(&buf);
9679 Self::arbitrary(&mut unstructured).unwrap_or_default()
9680 }
9681}
9682impl Default for COMPONENT_INFORMATION_BASIC_DATA {
9683 fn default() -> Self {
9684 Self::DEFAULT.clone()
9685 }
9686}
9687impl MessageData for COMPONENT_INFORMATION_BASIC_DATA {
9688 type Message = MavMessage;
9689 const ID: u32 = 396u32;
9690 const NAME: &'static str = "COMPONENT_INFORMATION_BASIC";
9691 const EXTRA_CRC: u8 = 50u8;
9692 const ENCODED_LEN: usize = 160usize;
9693 fn deser(
9694 _version: MavlinkVersion,
9695 __input: &[u8],
9696 ) -> Result<Self, ::mavlink_core::error::ParserError> {
9697 let avail_len = __input.len();
9698 let mut payload_buf = [0; Self::ENCODED_LEN];
9699 let mut buf = if avail_len < Self::ENCODED_LEN {
9700 payload_buf[0..avail_len].copy_from_slice(__input);
9701 Bytes::new(&payload_buf)
9702 } else {
9703 Bytes::new(__input)
9704 };
9705 let mut __struct = Self::default();
9706 let tmp = buf.get_u64_le();
9707 __struct.capabilities = MavProtocolCapability::from_bits(
9708 tmp & MavProtocolCapability::all().bits(),
9709 )
9710 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
9711 flag_type: "MavProtocolCapability",
9712 value: tmp as u32,
9713 })?;
9714 __struct.time_boot_ms = buf.get_u32_le();
9715 __struct.time_manufacture_s = buf.get_u32_le();
9716 for v in &mut __struct.vendor_name {
9717 let val = buf.get_u8();
9718 *v = val;
9719 }
9720 for v in &mut __struct.model_name {
9721 let val = buf.get_u8();
9722 *v = val;
9723 }
9724 for v in &mut __struct.software_version {
9725 let val = buf.get_u8();
9726 *v = val;
9727 }
9728 for v in &mut __struct.hardware_version {
9729 let val = buf.get_u8();
9730 *v = val;
9731 }
9732 for v in &mut __struct.serial_number {
9733 let val = buf.get_u8();
9734 *v = val;
9735 }
9736 Ok(__struct)
9737 }
9738 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
9739 let mut __tmp = BytesMut::new(bytes);
9740 #[allow(clippy::absurd_extreme_comparisons)]
9741 #[allow(unused_comparisons)]
9742 if __tmp.remaining() < Self::ENCODED_LEN {
9743 panic!(
9744 "buffer is too small (need {} bytes, but got {})",
9745 Self::ENCODED_LEN,
9746 __tmp.remaining(),
9747 )
9748 }
9749 __tmp.put_u64_le(self.capabilities.bits());
9750 __tmp.put_u32_le(self.time_boot_ms);
9751 __tmp.put_u32_le(self.time_manufacture_s);
9752 for val in &self.vendor_name {
9753 __tmp.put_u8(*val);
9754 }
9755 for val in &self.model_name {
9756 __tmp.put_u8(*val);
9757 }
9758 for val in &self.software_version {
9759 __tmp.put_u8(*val);
9760 }
9761 for val in &self.hardware_version {
9762 __tmp.put_u8(*val);
9763 }
9764 for val in &self.serial_number {
9765 __tmp.put_u8(*val);
9766 }
9767 if matches!(version, MavlinkVersion::V2) {
9768 let len = __tmp.len();
9769 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
9770 } else {
9771 __tmp.len()
9772 }
9773 }
9774}
9775#[doc = "Component metadata message, which may be requested using MAV_CMD_REQUEST_MESSAGE. This contains the MAVLink FTP URI and CRC for the component's general metadata file. The file must be hosted on the component, and may be xz compressed. The file CRC can be used for file caching. The general metadata file can be read to get the locations of other metadata files (COMP_METADATA_TYPE) and translations, which may be hosted either on the vehicle or the internet. For more information see: <https://mavlink.io/en/services/component_information.html>. Note: Camera components should use CAMERA_INFORMATION instead, and autopilots may use both this message and AUTOPILOT_VERSION."]
9776#[doc = ""]
9777#[doc = "ID: 397"]
9778#[derive(Debug, Clone, PartialEq)]
9779#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
9780#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
9781pub struct COMPONENT_METADATA_DATA {
9782 #[doc = "Timestamp (time since system boot)."]
9783 pub time_boot_ms: u32,
9784 #[doc = "CRC32 of the general metadata file."]
9785 pub file_crc: u32,
9786 #[doc = "MAVLink FTP URI for the general metadata file (COMP_METADATA_TYPE_GENERAL), which may be compressed with xz. The file contains general component metadata, and may contain URI links for additional metadata (see COMP_METADATA_TYPE). The information is static from boot, and may be generated at compile time. The string needs to be zero terminated."]
9787 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
9788 pub uri: [u8; 100],
9789}
9790impl COMPONENT_METADATA_DATA {
9791 pub const ENCODED_LEN: usize = 108usize;
9792 pub const DEFAULT: Self = Self {
9793 time_boot_ms: 0_u32,
9794 file_crc: 0_u32,
9795 uri: [0_u8; 100usize],
9796 };
9797 #[cfg(feature = "arbitrary")]
9798 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
9799 use arbitrary::{Arbitrary, Unstructured};
9800 let mut buf = [0u8; 1024];
9801 rng.fill_bytes(&mut buf);
9802 let mut unstructured = Unstructured::new(&buf);
9803 Self::arbitrary(&mut unstructured).unwrap_or_default()
9804 }
9805}
9806impl Default for COMPONENT_METADATA_DATA {
9807 fn default() -> Self {
9808 Self::DEFAULT.clone()
9809 }
9810}
9811impl MessageData for COMPONENT_METADATA_DATA {
9812 type Message = MavMessage;
9813 const ID: u32 = 397u32;
9814 const NAME: &'static str = "COMPONENT_METADATA";
9815 const EXTRA_CRC: u8 = 182u8;
9816 const ENCODED_LEN: usize = 108usize;
9817 fn deser(
9818 _version: MavlinkVersion,
9819 __input: &[u8],
9820 ) -> Result<Self, ::mavlink_core::error::ParserError> {
9821 let avail_len = __input.len();
9822 let mut payload_buf = [0; Self::ENCODED_LEN];
9823 let mut buf = if avail_len < Self::ENCODED_LEN {
9824 payload_buf[0..avail_len].copy_from_slice(__input);
9825 Bytes::new(&payload_buf)
9826 } else {
9827 Bytes::new(__input)
9828 };
9829 let mut __struct = Self::default();
9830 __struct.time_boot_ms = buf.get_u32_le();
9831 __struct.file_crc = buf.get_u32_le();
9832 for v in &mut __struct.uri {
9833 let val = buf.get_u8();
9834 *v = val;
9835 }
9836 Ok(__struct)
9837 }
9838 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
9839 let mut __tmp = BytesMut::new(bytes);
9840 #[allow(clippy::absurd_extreme_comparisons)]
9841 #[allow(unused_comparisons)]
9842 if __tmp.remaining() < Self::ENCODED_LEN {
9843 panic!(
9844 "buffer is too small (need {} bytes, but got {})",
9845 Self::ENCODED_LEN,
9846 __tmp.remaining(),
9847 )
9848 }
9849 __tmp.put_u32_le(self.time_boot_ms);
9850 __tmp.put_u32_le(self.file_crc);
9851 for val in &self.uri {
9852 __tmp.put_u8(*val);
9853 }
9854 if matches!(version, MavlinkVersion::V2) {
9855 let len = __tmp.len();
9856 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
9857 } else {
9858 __tmp.len()
9859 }
9860 }
9861}
9862#[doc = "The smoothed, monotonic system state used to feed the control loops of the system."]
9863#[doc = ""]
9864#[doc = "ID: 146"]
9865#[derive(Debug, Clone, PartialEq)]
9866#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
9867#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
9868pub struct CONTROL_SYSTEM_STATE_DATA {
9869 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
9870 pub time_usec: u64,
9871 #[doc = "X acceleration in body frame"]
9872 pub x_acc: f32,
9873 #[doc = "Y acceleration in body frame"]
9874 pub y_acc: f32,
9875 #[doc = "Z acceleration in body frame"]
9876 pub z_acc: f32,
9877 #[doc = "X velocity in body frame"]
9878 pub x_vel: f32,
9879 #[doc = "Y velocity in body frame"]
9880 pub y_vel: f32,
9881 #[doc = "Z velocity in body frame"]
9882 pub z_vel: f32,
9883 #[doc = "X position in local frame"]
9884 pub x_pos: f32,
9885 #[doc = "Y position in local frame"]
9886 pub y_pos: f32,
9887 #[doc = "Z position in local frame"]
9888 pub z_pos: f32,
9889 #[doc = "Airspeed, set to -1 if unknown"]
9890 pub airspeed: f32,
9891 #[doc = "Variance of body velocity estimate"]
9892 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
9893 pub vel_variance: [f32; 3],
9894 #[doc = "Variance in local position"]
9895 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
9896 pub pos_variance: [f32; 3],
9897 #[doc = "The attitude, represented as Quaternion"]
9898 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
9899 pub q: [f32; 4],
9900 #[doc = "Angular rate in roll axis"]
9901 pub roll_rate: f32,
9902 #[doc = "Angular rate in pitch axis"]
9903 pub pitch_rate: f32,
9904 #[doc = "Angular rate in yaw axis"]
9905 pub yaw_rate: f32,
9906}
9907impl CONTROL_SYSTEM_STATE_DATA {
9908 pub const ENCODED_LEN: usize = 100usize;
9909 pub const DEFAULT: Self = Self {
9910 time_usec: 0_u64,
9911 x_acc: 0.0_f32,
9912 y_acc: 0.0_f32,
9913 z_acc: 0.0_f32,
9914 x_vel: 0.0_f32,
9915 y_vel: 0.0_f32,
9916 z_vel: 0.0_f32,
9917 x_pos: 0.0_f32,
9918 y_pos: 0.0_f32,
9919 z_pos: 0.0_f32,
9920 airspeed: 0.0_f32,
9921 vel_variance: [0.0_f32; 3usize],
9922 pos_variance: [0.0_f32; 3usize],
9923 q: [0.0_f32; 4usize],
9924 roll_rate: 0.0_f32,
9925 pitch_rate: 0.0_f32,
9926 yaw_rate: 0.0_f32,
9927 };
9928 #[cfg(feature = "arbitrary")]
9929 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
9930 use arbitrary::{Arbitrary, Unstructured};
9931 let mut buf = [0u8; 1024];
9932 rng.fill_bytes(&mut buf);
9933 let mut unstructured = Unstructured::new(&buf);
9934 Self::arbitrary(&mut unstructured).unwrap_or_default()
9935 }
9936}
9937impl Default for CONTROL_SYSTEM_STATE_DATA {
9938 fn default() -> Self {
9939 Self::DEFAULT.clone()
9940 }
9941}
9942impl MessageData for CONTROL_SYSTEM_STATE_DATA {
9943 type Message = MavMessage;
9944 const ID: u32 = 146u32;
9945 const NAME: &'static str = "CONTROL_SYSTEM_STATE";
9946 const EXTRA_CRC: u8 = 103u8;
9947 const ENCODED_LEN: usize = 100usize;
9948 fn deser(
9949 _version: MavlinkVersion,
9950 __input: &[u8],
9951 ) -> Result<Self, ::mavlink_core::error::ParserError> {
9952 let avail_len = __input.len();
9953 let mut payload_buf = [0; Self::ENCODED_LEN];
9954 let mut buf = if avail_len < Self::ENCODED_LEN {
9955 payload_buf[0..avail_len].copy_from_slice(__input);
9956 Bytes::new(&payload_buf)
9957 } else {
9958 Bytes::new(__input)
9959 };
9960 let mut __struct = Self::default();
9961 __struct.time_usec = buf.get_u64_le();
9962 __struct.x_acc = buf.get_f32_le();
9963 __struct.y_acc = buf.get_f32_le();
9964 __struct.z_acc = buf.get_f32_le();
9965 __struct.x_vel = buf.get_f32_le();
9966 __struct.y_vel = buf.get_f32_le();
9967 __struct.z_vel = buf.get_f32_le();
9968 __struct.x_pos = buf.get_f32_le();
9969 __struct.y_pos = buf.get_f32_le();
9970 __struct.z_pos = buf.get_f32_le();
9971 __struct.airspeed = buf.get_f32_le();
9972 for v in &mut __struct.vel_variance {
9973 let val = buf.get_f32_le();
9974 *v = val;
9975 }
9976 for v in &mut __struct.pos_variance {
9977 let val = buf.get_f32_le();
9978 *v = val;
9979 }
9980 for v in &mut __struct.q {
9981 let val = buf.get_f32_le();
9982 *v = val;
9983 }
9984 __struct.roll_rate = buf.get_f32_le();
9985 __struct.pitch_rate = buf.get_f32_le();
9986 __struct.yaw_rate = buf.get_f32_le();
9987 Ok(__struct)
9988 }
9989 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
9990 let mut __tmp = BytesMut::new(bytes);
9991 #[allow(clippy::absurd_extreme_comparisons)]
9992 #[allow(unused_comparisons)]
9993 if __tmp.remaining() < Self::ENCODED_LEN {
9994 panic!(
9995 "buffer is too small (need {} bytes, but got {})",
9996 Self::ENCODED_LEN,
9997 __tmp.remaining(),
9998 )
9999 }
10000 __tmp.put_u64_le(self.time_usec);
10001 __tmp.put_f32_le(self.x_acc);
10002 __tmp.put_f32_le(self.y_acc);
10003 __tmp.put_f32_le(self.z_acc);
10004 __tmp.put_f32_le(self.x_vel);
10005 __tmp.put_f32_le(self.y_vel);
10006 __tmp.put_f32_le(self.z_vel);
10007 __tmp.put_f32_le(self.x_pos);
10008 __tmp.put_f32_le(self.y_pos);
10009 __tmp.put_f32_le(self.z_pos);
10010 __tmp.put_f32_le(self.airspeed);
10011 for val in &self.vel_variance {
10012 __tmp.put_f32_le(*val);
10013 }
10014 for val in &self.pos_variance {
10015 __tmp.put_f32_le(*val);
10016 }
10017 for val in &self.q {
10018 __tmp.put_f32_le(*val);
10019 }
10020 __tmp.put_f32_le(self.roll_rate);
10021 __tmp.put_f32_le(self.pitch_rate);
10022 __tmp.put_f32_le(self.yaw_rate);
10023 if matches!(version, MavlinkVersion::V2) {
10024 let len = __tmp.len();
10025 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
10026 } else {
10027 __tmp.len()
10028 }
10029 }
10030}
10031#[doc = "Regular broadcast for the current latest event sequence number for a component. This is used to check for dropped events."]
10032#[doc = ""]
10033#[doc = "ID: 411"]
10034#[derive(Debug, Clone, PartialEq)]
10035#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
10036#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
10037pub struct CURRENT_EVENT_SEQUENCE_DATA {
10038 #[doc = "Sequence number."]
10039 pub sequence: u16,
10040 #[doc = "Flag bitset."]
10041 pub flags: MavEventCurrentSequenceFlags,
10042}
10043impl CURRENT_EVENT_SEQUENCE_DATA {
10044 pub const ENCODED_LEN: usize = 3usize;
10045 pub const DEFAULT: Self = Self {
10046 sequence: 0_u16,
10047 flags: MavEventCurrentSequenceFlags::DEFAULT,
10048 };
10049 #[cfg(feature = "arbitrary")]
10050 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
10051 use arbitrary::{Arbitrary, Unstructured};
10052 let mut buf = [0u8; 1024];
10053 rng.fill_bytes(&mut buf);
10054 let mut unstructured = Unstructured::new(&buf);
10055 Self::arbitrary(&mut unstructured).unwrap_or_default()
10056 }
10057}
10058impl Default for CURRENT_EVENT_SEQUENCE_DATA {
10059 fn default() -> Self {
10060 Self::DEFAULT.clone()
10061 }
10062}
10063impl MessageData for CURRENT_EVENT_SEQUENCE_DATA {
10064 type Message = MavMessage;
10065 const ID: u32 = 411u32;
10066 const NAME: &'static str = "CURRENT_EVENT_SEQUENCE";
10067 const EXTRA_CRC: u8 = 106u8;
10068 const ENCODED_LEN: usize = 3usize;
10069 fn deser(
10070 _version: MavlinkVersion,
10071 __input: &[u8],
10072 ) -> Result<Self, ::mavlink_core::error::ParserError> {
10073 let avail_len = __input.len();
10074 let mut payload_buf = [0; Self::ENCODED_LEN];
10075 let mut buf = if avail_len < Self::ENCODED_LEN {
10076 payload_buf[0..avail_len].copy_from_slice(__input);
10077 Bytes::new(&payload_buf)
10078 } else {
10079 Bytes::new(__input)
10080 };
10081 let mut __struct = Self::default();
10082 __struct.sequence = buf.get_u16_le();
10083 let tmp = buf.get_u8();
10084 __struct.flags =
10085 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
10086 enum_type: "MavEventCurrentSequenceFlags",
10087 value: tmp as u32,
10088 })?;
10089 Ok(__struct)
10090 }
10091 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
10092 let mut __tmp = BytesMut::new(bytes);
10093 #[allow(clippy::absurd_extreme_comparisons)]
10094 #[allow(unused_comparisons)]
10095 if __tmp.remaining() < Self::ENCODED_LEN {
10096 panic!(
10097 "buffer is too small (need {} bytes, but got {})",
10098 Self::ENCODED_LEN,
10099 __tmp.remaining(),
10100 )
10101 }
10102 __tmp.put_u16_le(self.sequence);
10103 __tmp.put_u8(self.flags as u8);
10104 if matches!(version, MavlinkVersion::V2) {
10105 let len = __tmp.len();
10106 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
10107 } else {
10108 __tmp.len()
10109 }
10110 }
10111}
10112#[doc = "Get the current mode. This should be emitted on any mode change, and broadcast at low rate (nominally 0.5 Hz). It may be requested using MAV_CMD_REQUEST_MESSAGE. See <https://mavlink.io/en/services/standard_modes.html>."]
10113#[doc = ""]
10114#[doc = "ID: 436"]
10115#[derive(Debug, Clone, PartialEq)]
10116#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
10117#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
10118pub struct CURRENT_MODE_DATA {
10119 #[doc = "A bitfield for use for autopilot-specific flags"]
10120 pub custom_mode: u32,
10121 #[doc = "The custom_mode of the mode that was last commanded by the user (for example, with MAV_CMD_DO_SET_STANDARD_MODE, MAV_CMD_DO_SET_MODE or via RC). This should usually be the same as custom_mode. It will be different if the vehicle is unable to enter the intended mode, or has left that mode due to a failsafe condition. 0 indicates the intended custom mode is unknown/not supplied"]
10122 pub intended_custom_mode: u32,
10123 #[doc = "Standard mode."]
10124 pub standard_mode: MavStandardMode,
10125}
10126impl CURRENT_MODE_DATA {
10127 pub const ENCODED_LEN: usize = 9usize;
10128 pub const DEFAULT: Self = Self {
10129 custom_mode: 0_u32,
10130 intended_custom_mode: 0_u32,
10131 standard_mode: MavStandardMode::DEFAULT,
10132 };
10133 #[cfg(feature = "arbitrary")]
10134 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
10135 use arbitrary::{Arbitrary, Unstructured};
10136 let mut buf = [0u8; 1024];
10137 rng.fill_bytes(&mut buf);
10138 let mut unstructured = Unstructured::new(&buf);
10139 Self::arbitrary(&mut unstructured).unwrap_or_default()
10140 }
10141}
10142impl Default for CURRENT_MODE_DATA {
10143 fn default() -> Self {
10144 Self::DEFAULT.clone()
10145 }
10146}
10147impl MessageData for CURRENT_MODE_DATA {
10148 type Message = MavMessage;
10149 const ID: u32 = 436u32;
10150 const NAME: &'static str = "CURRENT_MODE";
10151 const EXTRA_CRC: u8 = 193u8;
10152 const ENCODED_LEN: usize = 9usize;
10153 fn deser(
10154 _version: MavlinkVersion,
10155 __input: &[u8],
10156 ) -> Result<Self, ::mavlink_core::error::ParserError> {
10157 let avail_len = __input.len();
10158 let mut payload_buf = [0; Self::ENCODED_LEN];
10159 let mut buf = if avail_len < Self::ENCODED_LEN {
10160 payload_buf[0..avail_len].copy_from_slice(__input);
10161 Bytes::new(&payload_buf)
10162 } else {
10163 Bytes::new(__input)
10164 };
10165 let mut __struct = Self::default();
10166 __struct.custom_mode = buf.get_u32_le();
10167 __struct.intended_custom_mode = buf.get_u32_le();
10168 let tmp = buf.get_u8();
10169 __struct.standard_mode =
10170 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
10171 enum_type: "MavStandardMode",
10172 value: tmp as u32,
10173 })?;
10174 Ok(__struct)
10175 }
10176 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
10177 let mut __tmp = BytesMut::new(bytes);
10178 #[allow(clippy::absurd_extreme_comparisons)]
10179 #[allow(unused_comparisons)]
10180 if __tmp.remaining() < Self::ENCODED_LEN {
10181 panic!(
10182 "buffer is too small (need {} bytes, but got {})",
10183 Self::ENCODED_LEN,
10184 __tmp.remaining(),
10185 )
10186 }
10187 __tmp.put_u32_le(self.custom_mode);
10188 __tmp.put_u32_le(self.intended_custom_mode);
10189 __tmp.put_u8(self.standard_mode as u8);
10190 if matches!(version, MavlinkVersion::V2) {
10191 let len = __tmp.len();
10192 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
10193 } else {
10194 __tmp.len()
10195 }
10196 }
10197}
10198#[deprecated = " See `MESSAGE_INTERVAL` (Deprecated since 2015-08)"]
10199#[doc = "Data stream status information."]
10200#[doc = ""]
10201#[doc = "ID: 67"]
10202#[derive(Debug, Clone, PartialEq)]
10203#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
10204#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
10205pub struct DATA_STREAM_DATA {
10206 #[doc = "The message rate"]
10207 pub message_rate: u16,
10208 #[doc = "The ID of the requested data stream"]
10209 pub stream_id: u8,
10210 #[doc = "1 stream is enabled, 0 stream is stopped."]
10211 pub on_off: u8,
10212}
10213impl DATA_STREAM_DATA {
10214 pub const ENCODED_LEN: usize = 4usize;
10215 pub const DEFAULT: Self = Self {
10216 message_rate: 0_u16,
10217 stream_id: 0_u8,
10218 on_off: 0_u8,
10219 };
10220 #[cfg(feature = "arbitrary")]
10221 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
10222 use arbitrary::{Arbitrary, Unstructured};
10223 let mut buf = [0u8; 1024];
10224 rng.fill_bytes(&mut buf);
10225 let mut unstructured = Unstructured::new(&buf);
10226 Self::arbitrary(&mut unstructured).unwrap_or_default()
10227 }
10228}
10229impl Default for DATA_STREAM_DATA {
10230 fn default() -> Self {
10231 Self::DEFAULT.clone()
10232 }
10233}
10234impl MessageData for DATA_STREAM_DATA {
10235 type Message = MavMessage;
10236 const ID: u32 = 67u32;
10237 const NAME: &'static str = "DATA_STREAM";
10238 const EXTRA_CRC: u8 = 21u8;
10239 const ENCODED_LEN: usize = 4usize;
10240 fn deser(
10241 _version: MavlinkVersion,
10242 __input: &[u8],
10243 ) -> Result<Self, ::mavlink_core::error::ParserError> {
10244 let avail_len = __input.len();
10245 let mut payload_buf = [0; Self::ENCODED_LEN];
10246 let mut buf = if avail_len < Self::ENCODED_LEN {
10247 payload_buf[0..avail_len].copy_from_slice(__input);
10248 Bytes::new(&payload_buf)
10249 } else {
10250 Bytes::new(__input)
10251 };
10252 let mut __struct = Self::default();
10253 __struct.message_rate = buf.get_u16_le();
10254 __struct.stream_id = buf.get_u8();
10255 __struct.on_off = buf.get_u8();
10256 Ok(__struct)
10257 }
10258 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
10259 let mut __tmp = BytesMut::new(bytes);
10260 #[allow(clippy::absurd_extreme_comparisons)]
10261 #[allow(unused_comparisons)]
10262 if __tmp.remaining() < Self::ENCODED_LEN {
10263 panic!(
10264 "buffer is too small (need {} bytes, but got {})",
10265 Self::ENCODED_LEN,
10266 __tmp.remaining(),
10267 )
10268 }
10269 __tmp.put_u16_le(self.message_rate);
10270 __tmp.put_u8(self.stream_id);
10271 __tmp.put_u8(self.on_off);
10272 if matches!(version, MavlinkVersion::V2) {
10273 let len = __tmp.len();
10274 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
10275 } else {
10276 __tmp.len()
10277 }
10278 }
10279}
10280#[doc = "Handshake message to initiate, control and stop image streaming when using the Image Transmission Protocol: <https://mavlink.io/en/services/image_transmission.html>."]
10281#[doc = ""]
10282#[doc = "ID: 130"]
10283#[derive(Debug, Clone, PartialEq)]
10284#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
10285#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
10286pub struct DATA_TRANSMISSION_HANDSHAKE_DATA {
10287 #[doc = "total data size (set on ACK only)."]
10288 pub size: u32,
10289 #[doc = "Width of a matrix or image."]
10290 pub width: u16,
10291 #[doc = "Height of a matrix or image."]
10292 pub height: u16,
10293 #[doc = "Number of packets being sent (set on ACK only)."]
10294 pub packets: u16,
10295 #[doc = "Type of requested/acknowledged data."]
10296 pub mavtype: MavlinkDataStreamType,
10297 #[doc = "Payload size per packet (normally 253 byte, see DATA field size in message ENCAPSULATED_DATA) (set on ACK only)."]
10298 pub payload: u8,
10299 #[doc = "JPEG quality. Values: [1-100]."]
10300 pub jpg_quality: u8,
10301}
10302impl DATA_TRANSMISSION_HANDSHAKE_DATA {
10303 pub const ENCODED_LEN: usize = 13usize;
10304 pub const DEFAULT: Self = Self {
10305 size: 0_u32,
10306 width: 0_u16,
10307 height: 0_u16,
10308 packets: 0_u16,
10309 mavtype: MavlinkDataStreamType::DEFAULT,
10310 payload: 0_u8,
10311 jpg_quality: 0_u8,
10312 };
10313 #[cfg(feature = "arbitrary")]
10314 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
10315 use arbitrary::{Arbitrary, Unstructured};
10316 let mut buf = [0u8; 1024];
10317 rng.fill_bytes(&mut buf);
10318 let mut unstructured = Unstructured::new(&buf);
10319 Self::arbitrary(&mut unstructured).unwrap_or_default()
10320 }
10321}
10322impl Default for DATA_TRANSMISSION_HANDSHAKE_DATA {
10323 fn default() -> Self {
10324 Self::DEFAULT.clone()
10325 }
10326}
10327impl MessageData for DATA_TRANSMISSION_HANDSHAKE_DATA {
10328 type Message = MavMessage;
10329 const ID: u32 = 130u32;
10330 const NAME: &'static str = "DATA_TRANSMISSION_HANDSHAKE";
10331 const EXTRA_CRC: u8 = 29u8;
10332 const ENCODED_LEN: usize = 13usize;
10333 fn deser(
10334 _version: MavlinkVersion,
10335 __input: &[u8],
10336 ) -> Result<Self, ::mavlink_core::error::ParserError> {
10337 let avail_len = __input.len();
10338 let mut payload_buf = [0; Self::ENCODED_LEN];
10339 let mut buf = if avail_len < Self::ENCODED_LEN {
10340 payload_buf[0..avail_len].copy_from_slice(__input);
10341 Bytes::new(&payload_buf)
10342 } else {
10343 Bytes::new(__input)
10344 };
10345 let mut __struct = Self::default();
10346 __struct.size = buf.get_u32_le();
10347 __struct.width = buf.get_u16_le();
10348 __struct.height = buf.get_u16_le();
10349 __struct.packets = buf.get_u16_le();
10350 let tmp = buf.get_u8();
10351 __struct.mavtype =
10352 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
10353 enum_type: "MavlinkDataStreamType",
10354 value: tmp as u32,
10355 })?;
10356 __struct.payload = buf.get_u8();
10357 __struct.jpg_quality = buf.get_u8();
10358 Ok(__struct)
10359 }
10360 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
10361 let mut __tmp = BytesMut::new(bytes);
10362 #[allow(clippy::absurd_extreme_comparisons)]
10363 #[allow(unused_comparisons)]
10364 if __tmp.remaining() < Self::ENCODED_LEN {
10365 panic!(
10366 "buffer is too small (need {} bytes, but got {})",
10367 Self::ENCODED_LEN,
10368 __tmp.remaining(),
10369 )
10370 }
10371 __tmp.put_u32_le(self.size);
10372 __tmp.put_u16_le(self.width);
10373 __tmp.put_u16_le(self.height);
10374 __tmp.put_u16_le(self.packets);
10375 __tmp.put_u8(self.mavtype as u8);
10376 __tmp.put_u8(self.payload);
10377 __tmp.put_u8(self.jpg_quality);
10378 if matches!(version, MavlinkVersion::V2) {
10379 let len = __tmp.len();
10380 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
10381 } else {
10382 __tmp.len()
10383 }
10384 }
10385}
10386#[doc = "Send a debug value. The index is used to discriminate between values. These values show up in the plot of QGroundControl as DEBUG N."]
10387#[doc = ""]
10388#[doc = "ID: 254"]
10389#[derive(Debug, Clone, PartialEq)]
10390#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
10391#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
10392pub struct DEBUG_DATA {
10393 #[doc = "Timestamp (time since system boot)."]
10394 pub time_boot_ms: u32,
10395 #[doc = "DEBUG value"]
10396 pub value: f32,
10397 #[doc = "index of debug variable"]
10398 pub ind: u8,
10399}
10400impl DEBUG_DATA {
10401 pub const ENCODED_LEN: usize = 9usize;
10402 pub const DEFAULT: Self = Self {
10403 time_boot_ms: 0_u32,
10404 value: 0.0_f32,
10405 ind: 0_u8,
10406 };
10407 #[cfg(feature = "arbitrary")]
10408 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
10409 use arbitrary::{Arbitrary, Unstructured};
10410 let mut buf = [0u8; 1024];
10411 rng.fill_bytes(&mut buf);
10412 let mut unstructured = Unstructured::new(&buf);
10413 Self::arbitrary(&mut unstructured).unwrap_or_default()
10414 }
10415}
10416impl Default for DEBUG_DATA {
10417 fn default() -> Self {
10418 Self::DEFAULT.clone()
10419 }
10420}
10421impl MessageData for DEBUG_DATA {
10422 type Message = MavMessage;
10423 const ID: u32 = 254u32;
10424 const NAME: &'static str = "DEBUG";
10425 const EXTRA_CRC: u8 = 46u8;
10426 const ENCODED_LEN: usize = 9usize;
10427 fn deser(
10428 _version: MavlinkVersion,
10429 __input: &[u8],
10430 ) -> Result<Self, ::mavlink_core::error::ParserError> {
10431 let avail_len = __input.len();
10432 let mut payload_buf = [0; Self::ENCODED_LEN];
10433 let mut buf = if avail_len < Self::ENCODED_LEN {
10434 payload_buf[0..avail_len].copy_from_slice(__input);
10435 Bytes::new(&payload_buf)
10436 } else {
10437 Bytes::new(__input)
10438 };
10439 let mut __struct = Self::default();
10440 __struct.time_boot_ms = buf.get_u32_le();
10441 __struct.value = buf.get_f32_le();
10442 __struct.ind = buf.get_u8();
10443 Ok(__struct)
10444 }
10445 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
10446 let mut __tmp = BytesMut::new(bytes);
10447 #[allow(clippy::absurd_extreme_comparisons)]
10448 #[allow(unused_comparisons)]
10449 if __tmp.remaining() < Self::ENCODED_LEN {
10450 panic!(
10451 "buffer is too small (need {} bytes, but got {})",
10452 Self::ENCODED_LEN,
10453 __tmp.remaining(),
10454 )
10455 }
10456 __tmp.put_u32_le(self.time_boot_ms);
10457 __tmp.put_f32_le(self.value);
10458 __tmp.put_u8(self.ind);
10459 if matches!(version, MavlinkVersion::V2) {
10460 let len = __tmp.len();
10461 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
10462 } else {
10463 __tmp.len()
10464 }
10465 }
10466}
10467#[doc = "Large debug/prototyping array. The message uses the maximum available payload for data. The array_id and name fields are used to discriminate between messages in code and in user interfaces (respectively). Do not use in production code."]
10468#[doc = ""]
10469#[doc = "ID: 350"]
10470#[derive(Debug, Clone, PartialEq)]
10471#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
10472#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
10473pub struct DEBUG_FLOAT_ARRAY_DATA {
10474 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
10475 pub time_usec: u64,
10476 #[doc = "Unique ID used to discriminate between arrays"]
10477 pub array_id: u16,
10478 #[doc = "Name, for human-friendly display in a Ground Control Station"]
10479 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
10480 pub name: [u8; 10],
10481 #[doc = "data"]
10482 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
10483 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
10484 pub data: [f32; 58],
10485}
10486impl DEBUG_FLOAT_ARRAY_DATA {
10487 pub const ENCODED_LEN: usize = 252usize;
10488 pub const DEFAULT: Self = Self {
10489 time_usec: 0_u64,
10490 array_id: 0_u16,
10491 name: [0_u8; 10usize],
10492 data: [0.0_f32; 58usize],
10493 };
10494 #[cfg(feature = "arbitrary")]
10495 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
10496 use arbitrary::{Arbitrary, Unstructured};
10497 let mut buf = [0u8; 1024];
10498 rng.fill_bytes(&mut buf);
10499 let mut unstructured = Unstructured::new(&buf);
10500 Self::arbitrary(&mut unstructured).unwrap_or_default()
10501 }
10502}
10503impl Default for DEBUG_FLOAT_ARRAY_DATA {
10504 fn default() -> Self {
10505 Self::DEFAULT.clone()
10506 }
10507}
10508impl MessageData for DEBUG_FLOAT_ARRAY_DATA {
10509 type Message = MavMessage;
10510 const ID: u32 = 350u32;
10511 const NAME: &'static str = "DEBUG_FLOAT_ARRAY";
10512 const EXTRA_CRC: u8 = 232u8;
10513 const ENCODED_LEN: usize = 252usize;
10514 fn deser(
10515 _version: MavlinkVersion,
10516 __input: &[u8],
10517 ) -> Result<Self, ::mavlink_core::error::ParserError> {
10518 let avail_len = __input.len();
10519 let mut payload_buf = [0; Self::ENCODED_LEN];
10520 let mut buf = if avail_len < Self::ENCODED_LEN {
10521 payload_buf[0..avail_len].copy_from_slice(__input);
10522 Bytes::new(&payload_buf)
10523 } else {
10524 Bytes::new(__input)
10525 };
10526 let mut __struct = Self::default();
10527 __struct.time_usec = buf.get_u64_le();
10528 __struct.array_id = buf.get_u16_le();
10529 for v in &mut __struct.name {
10530 let val = buf.get_u8();
10531 *v = val;
10532 }
10533 for v in &mut __struct.data {
10534 let val = buf.get_f32_le();
10535 *v = val;
10536 }
10537 Ok(__struct)
10538 }
10539 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
10540 let mut __tmp = BytesMut::new(bytes);
10541 #[allow(clippy::absurd_extreme_comparisons)]
10542 #[allow(unused_comparisons)]
10543 if __tmp.remaining() < Self::ENCODED_LEN {
10544 panic!(
10545 "buffer is too small (need {} bytes, but got {})",
10546 Self::ENCODED_LEN,
10547 __tmp.remaining(),
10548 )
10549 }
10550 __tmp.put_u64_le(self.time_usec);
10551 __tmp.put_u16_le(self.array_id);
10552 for val in &self.name {
10553 __tmp.put_u8(*val);
10554 }
10555 if matches!(version, MavlinkVersion::V2) {
10556 for val in &self.data {
10557 __tmp.put_f32_le(*val);
10558 }
10559 let len = __tmp.len();
10560 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
10561 } else {
10562 __tmp.len()
10563 }
10564 }
10565}
10566#[doc = "To debug something using a named 3D vector."]
10567#[doc = ""]
10568#[doc = "ID: 250"]
10569#[derive(Debug, Clone, PartialEq)]
10570#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
10571#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
10572pub struct DEBUG_VECT_DATA {
10573 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
10574 pub time_usec: u64,
10575 #[doc = "x"]
10576 pub x: f32,
10577 #[doc = "y"]
10578 pub y: f32,
10579 #[doc = "z"]
10580 pub z: f32,
10581 #[doc = "Name"]
10582 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
10583 pub name: [u8; 10],
10584}
10585impl DEBUG_VECT_DATA {
10586 pub const ENCODED_LEN: usize = 30usize;
10587 pub const DEFAULT: Self = Self {
10588 time_usec: 0_u64,
10589 x: 0.0_f32,
10590 y: 0.0_f32,
10591 z: 0.0_f32,
10592 name: [0_u8; 10usize],
10593 };
10594 #[cfg(feature = "arbitrary")]
10595 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
10596 use arbitrary::{Arbitrary, Unstructured};
10597 let mut buf = [0u8; 1024];
10598 rng.fill_bytes(&mut buf);
10599 let mut unstructured = Unstructured::new(&buf);
10600 Self::arbitrary(&mut unstructured).unwrap_or_default()
10601 }
10602}
10603impl Default for DEBUG_VECT_DATA {
10604 fn default() -> Self {
10605 Self::DEFAULT.clone()
10606 }
10607}
10608impl MessageData for DEBUG_VECT_DATA {
10609 type Message = MavMessage;
10610 const ID: u32 = 250u32;
10611 const NAME: &'static str = "DEBUG_VECT";
10612 const EXTRA_CRC: u8 = 49u8;
10613 const ENCODED_LEN: usize = 30usize;
10614 fn deser(
10615 _version: MavlinkVersion,
10616 __input: &[u8],
10617 ) -> Result<Self, ::mavlink_core::error::ParserError> {
10618 let avail_len = __input.len();
10619 let mut payload_buf = [0; Self::ENCODED_LEN];
10620 let mut buf = if avail_len < Self::ENCODED_LEN {
10621 payload_buf[0..avail_len].copy_from_slice(__input);
10622 Bytes::new(&payload_buf)
10623 } else {
10624 Bytes::new(__input)
10625 };
10626 let mut __struct = Self::default();
10627 __struct.time_usec = buf.get_u64_le();
10628 __struct.x = buf.get_f32_le();
10629 __struct.y = buf.get_f32_le();
10630 __struct.z = buf.get_f32_le();
10631 for v in &mut __struct.name {
10632 let val = buf.get_u8();
10633 *v = val;
10634 }
10635 Ok(__struct)
10636 }
10637 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
10638 let mut __tmp = BytesMut::new(bytes);
10639 #[allow(clippy::absurd_extreme_comparisons)]
10640 #[allow(unused_comparisons)]
10641 if __tmp.remaining() < Self::ENCODED_LEN {
10642 panic!(
10643 "buffer is too small (need {} bytes, but got {})",
10644 Self::ENCODED_LEN,
10645 __tmp.remaining(),
10646 )
10647 }
10648 __tmp.put_u64_le(self.time_usec);
10649 __tmp.put_f32_le(self.x);
10650 __tmp.put_f32_le(self.y);
10651 __tmp.put_f32_le(self.z);
10652 for val in &self.name {
10653 __tmp.put_u8(*val);
10654 }
10655 if matches!(version, MavlinkVersion::V2) {
10656 let len = __tmp.len();
10657 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
10658 } else {
10659 __tmp.len()
10660 }
10661 }
10662}
10663#[doc = "Distance sensor information for an onboard rangefinder."]
10664#[doc = ""]
10665#[doc = "ID: 132"]
10666#[derive(Debug, Clone, PartialEq)]
10667#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
10668#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
10669pub struct DISTANCE_SENSOR_DATA {
10670 #[doc = "Timestamp (time since system boot)."]
10671 pub time_boot_ms: u32,
10672 #[doc = "Minimum distance the sensor can measure"]
10673 pub min_distance: u16,
10674 #[doc = "Maximum distance the sensor can measure"]
10675 pub max_distance: u16,
10676 #[doc = "Current distance reading"]
10677 pub current_distance: u16,
10678 #[doc = "Type of distance sensor."]
10679 pub mavtype: MavDistanceSensor,
10680 #[doc = "Onboard ID of the sensor"]
10681 pub id: u8,
10682 #[doc = "Direction the sensor faces. downward-facing: ROTATION_PITCH_270, upward-facing: ROTATION_PITCH_90, backward-facing: ROTATION_PITCH_180, forward-facing: ROTATION_NONE, left-facing: ROTATION_YAW_90, right-facing: ROTATION_YAW_270"]
10683 pub orientation: MavSensorOrientation,
10684 #[doc = "Measurement variance. Max standard deviation is 6cm. UINT8_MAX if unknown."]
10685 pub covariance: u8,
10686 #[doc = "Horizontal Field of View (angle) where the distance measurement is valid and the field of view is known. Otherwise this is set to 0."]
10687 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
10688 pub horizontal_fov: f32,
10689 #[doc = "Vertical Field of View (angle) where the distance measurement is valid and the field of view is known. Otherwise this is set to 0."]
10690 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
10691 pub vertical_fov: f32,
10692 #[doc = "Quaternion of the sensor orientation in vehicle body frame (w, x, y, z order, zero-rotation is 1, 0, 0, 0). Zero-rotation is along the vehicle body x-axis. This field is required if the orientation is set to MAV_SENSOR_ROTATION_CUSTOM. Set it to 0 if invalid.\""]
10693 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
10694 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
10695 pub quaternion: [f32; 4],
10696 #[doc = "Signal quality of the sensor. Specific to each sensor type, representing the relation of the signal strength with the target reflectivity, distance, size or aspect, but normalised as a percentage. 0 = unknown/unset signal quality, 1 = invalid signal, 100 = perfect signal."]
10697 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
10698 pub signal_quality: u8,
10699}
10700impl DISTANCE_SENSOR_DATA {
10701 pub const ENCODED_LEN: usize = 39usize;
10702 pub const DEFAULT: Self = Self {
10703 time_boot_ms: 0_u32,
10704 min_distance: 0_u16,
10705 max_distance: 0_u16,
10706 current_distance: 0_u16,
10707 mavtype: MavDistanceSensor::DEFAULT,
10708 id: 0_u8,
10709 orientation: MavSensorOrientation::DEFAULT,
10710 covariance: 0_u8,
10711 horizontal_fov: 0.0_f32,
10712 vertical_fov: 0.0_f32,
10713 quaternion: [0.0_f32; 4usize],
10714 signal_quality: 0_u8,
10715 };
10716 #[cfg(feature = "arbitrary")]
10717 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
10718 use arbitrary::{Arbitrary, Unstructured};
10719 let mut buf = [0u8; 1024];
10720 rng.fill_bytes(&mut buf);
10721 let mut unstructured = Unstructured::new(&buf);
10722 Self::arbitrary(&mut unstructured).unwrap_or_default()
10723 }
10724}
10725impl Default for DISTANCE_SENSOR_DATA {
10726 fn default() -> Self {
10727 Self::DEFAULT.clone()
10728 }
10729}
10730impl MessageData for DISTANCE_SENSOR_DATA {
10731 type Message = MavMessage;
10732 const ID: u32 = 132u32;
10733 const NAME: &'static str = "DISTANCE_SENSOR";
10734 const EXTRA_CRC: u8 = 85u8;
10735 const ENCODED_LEN: usize = 39usize;
10736 fn deser(
10737 _version: MavlinkVersion,
10738 __input: &[u8],
10739 ) -> Result<Self, ::mavlink_core::error::ParserError> {
10740 let avail_len = __input.len();
10741 let mut payload_buf = [0; Self::ENCODED_LEN];
10742 let mut buf = if avail_len < Self::ENCODED_LEN {
10743 payload_buf[0..avail_len].copy_from_slice(__input);
10744 Bytes::new(&payload_buf)
10745 } else {
10746 Bytes::new(__input)
10747 };
10748 let mut __struct = Self::default();
10749 __struct.time_boot_ms = buf.get_u32_le();
10750 __struct.min_distance = buf.get_u16_le();
10751 __struct.max_distance = buf.get_u16_le();
10752 __struct.current_distance = buf.get_u16_le();
10753 let tmp = buf.get_u8();
10754 __struct.mavtype =
10755 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
10756 enum_type: "MavDistanceSensor",
10757 value: tmp as u32,
10758 })?;
10759 __struct.id = buf.get_u8();
10760 let tmp = buf.get_u8();
10761 __struct.orientation =
10762 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
10763 enum_type: "MavSensorOrientation",
10764 value: tmp as u32,
10765 })?;
10766 __struct.covariance = buf.get_u8();
10767 __struct.horizontal_fov = buf.get_f32_le();
10768 __struct.vertical_fov = buf.get_f32_le();
10769 for v in &mut __struct.quaternion {
10770 let val = buf.get_f32_le();
10771 *v = val;
10772 }
10773 __struct.signal_quality = buf.get_u8();
10774 Ok(__struct)
10775 }
10776 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
10777 let mut __tmp = BytesMut::new(bytes);
10778 #[allow(clippy::absurd_extreme_comparisons)]
10779 #[allow(unused_comparisons)]
10780 if __tmp.remaining() < Self::ENCODED_LEN {
10781 panic!(
10782 "buffer is too small (need {} bytes, but got {})",
10783 Self::ENCODED_LEN,
10784 __tmp.remaining(),
10785 )
10786 }
10787 __tmp.put_u32_le(self.time_boot_ms);
10788 __tmp.put_u16_le(self.min_distance);
10789 __tmp.put_u16_le(self.max_distance);
10790 __tmp.put_u16_le(self.current_distance);
10791 __tmp.put_u8(self.mavtype as u8);
10792 __tmp.put_u8(self.id);
10793 __tmp.put_u8(self.orientation as u8);
10794 __tmp.put_u8(self.covariance);
10795 if matches!(version, MavlinkVersion::V2) {
10796 __tmp.put_f32_le(self.horizontal_fov);
10797 __tmp.put_f32_le(self.vertical_fov);
10798 for val in &self.quaternion {
10799 __tmp.put_f32_le(*val);
10800 }
10801 __tmp.put_u8(self.signal_quality);
10802 let len = __tmp.len();
10803 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
10804 } else {
10805 __tmp.len()
10806 }
10807 }
10808}
10809#[doc = "EFI status output."]
10810#[doc = ""]
10811#[doc = "ID: 225"]
10812#[derive(Debug, Clone, PartialEq)]
10813#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
10814#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
10815pub struct EFI_STATUS_DATA {
10816 #[doc = "ECU index"]
10817 pub ecu_index: f32,
10818 #[doc = "RPM"]
10819 pub rpm: f32,
10820 #[doc = "Fuel consumed"]
10821 pub fuel_consumed: f32,
10822 #[doc = "Fuel flow rate"]
10823 pub fuel_flow: f32,
10824 #[doc = "Engine load"]
10825 pub engine_load: f32,
10826 #[doc = "Throttle position"]
10827 pub throttle_position: f32,
10828 #[doc = "Spark dwell time"]
10829 pub spark_dwell_time: f32,
10830 #[doc = "Barometric pressure"]
10831 pub barometric_pressure: f32,
10832 #[doc = "Intake manifold pressure("]
10833 pub intake_manifold_pressure: f32,
10834 #[doc = "Intake manifold temperature"]
10835 pub intake_manifold_temperature: f32,
10836 #[doc = "Cylinder head temperature"]
10837 pub cylinder_head_temperature: f32,
10838 #[doc = "Ignition timing (Crank angle degrees)"]
10839 pub ignition_timing: f32,
10840 #[doc = "Injection time"]
10841 pub injection_time: f32,
10842 #[doc = "Exhaust gas temperature"]
10843 pub exhaust_gas_temperature: f32,
10844 #[doc = "Output throttle"]
10845 pub throttle_out: f32,
10846 #[doc = "Pressure/temperature compensation"]
10847 pub pt_compensation: f32,
10848 #[doc = "EFI health status"]
10849 pub health: u8,
10850 #[doc = "Supply voltage to EFI sparking system. Zero in this value means \"unknown\", so if the supply voltage really is zero volts use 0.0001 instead."]
10851 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
10852 pub ignition_voltage: f32,
10853 #[doc = "Fuel pressure. Zero in this value means \"unknown\", so if the fuel pressure really is zero kPa use 0.0001 instead."]
10854 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
10855 pub fuel_pressure: f32,
10856}
10857impl EFI_STATUS_DATA {
10858 pub const ENCODED_LEN: usize = 73usize;
10859 pub const DEFAULT: Self = Self {
10860 ecu_index: 0.0_f32,
10861 rpm: 0.0_f32,
10862 fuel_consumed: 0.0_f32,
10863 fuel_flow: 0.0_f32,
10864 engine_load: 0.0_f32,
10865 throttle_position: 0.0_f32,
10866 spark_dwell_time: 0.0_f32,
10867 barometric_pressure: 0.0_f32,
10868 intake_manifold_pressure: 0.0_f32,
10869 intake_manifold_temperature: 0.0_f32,
10870 cylinder_head_temperature: 0.0_f32,
10871 ignition_timing: 0.0_f32,
10872 injection_time: 0.0_f32,
10873 exhaust_gas_temperature: 0.0_f32,
10874 throttle_out: 0.0_f32,
10875 pt_compensation: 0.0_f32,
10876 health: 0_u8,
10877 ignition_voltage: 0.0_f32,
10878 fuel_pressure: 0.0_f32,
10879 };
10880 #[cfg(feature = "arbitrary")]
10881 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
10882 use arbitrary::{Arbitrary, Unstructured};
10883 let mut buf = [0u8; 1024];
10884 rng.fill_bytes(&mut buf);
10885 let mut unstructured = Unstructured::new(&buf);
10886 Self::arbitrary(&mut unstructured).unwrap_or_default()
10887 }
10888}
10889impl Default for EFI_STATUS_DATA {
10890 fn default() -> Self {
10891 Self::DEFAULT.clone()
10892 }
10893}
10894impl MessageData for EFI_STATUS_DATA {
10895 type Message = MavMessage;
10896 const ID: u32 = 225u32;
10897 const NAME: &'static str = "EFI_STATUS";
10898 const EXTRA_CRC: u8 = 208u8;
10899 const ENCODED_LEN: usize = 73usize;
10900 fn deser(
10901 _version: MavlinkVersion,
10902 __input: &[u8],
10903 ) -> Result<Self, ::mavlink_core::error::ParserError> {
10904 let avail_len = __input.len();
10905 let mut payload_buf = [0; Self::ENCODED_LEN];
10906 let mut buf = if avail_len < Self::ENCODED_LEN {
10907 payload_buf[0..avail_len].copy_from_slice(__input);
10908 Bytes::new(&payload_buf)
10909 } else {
10910 Bytes::new(__input)
10911 };
10912 let mut __struct = Self::default();
10913 __struct.ecu_index = buf.get_f32_le();
10914 __struct.rpm = buf.get_f32_le();
10915 __struct.fuel_consumed = buf.get_f32_le();
10916 __struct.fuel_flow = buf.get_f32_le();
10917 __struct.engine_load = buf.get_f32_le();
10918 __struct.throttle_position = buf.get_f32_le();
10919 __struct.spark_dwell_time = buf.get_f32_le();
10920 __struct.barometric_pressure = buf.get_f32_le();
10921 __struct.intake_manifold_pressure = buf.get_f32_le();
10922 __struct.intake_manifold_temperature = buf.get_f32_le();
10923 __struct.cylinder_head_temperature = buf.get_f32_le();
10924 __struct.ignition_timing = buf.get_f32_le();
10925 __struct.injection_time = buf.get_f32_le();
10926 __struct.exhaust_gas_temperature = buf.get_f32_le();
10927 __struct.throttle_out = buf.get_f32_le();
10928 __struct.pt_compensation = buf.get_f32_le();
10929 __struct.health = buf.get_u8();
10930 __struct.ignition_voltage = buf.get_f32_le();
10931 __struct.fuel_pressure = buf.get_f32_le();
10932 Ok(__struct)
10933 }
10934 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
10935 let mut __tmp = BytesMut::new(bytes);
10936 #[allow(clippy::absurd_extreme_comparisons)]
10937 #[allow(unused_comparisons)]
10938 if __tmp.remaining() < Self::ENCODED_LEN {
10939 panic!(
10940 "buffer is too small (need {} bytes, but got {})",
10941 Self::ENCODED_LEN,
10942 __tmp.remaining(),
10943 )
10944 }
10945 __tmp.put_f32_le(self.ecu_index);
10946 __tmp.put_f32_le(self.rpm);
10947 __tmp.put_f32_le(self.fuel_consumed);
10948 __tmp.put_f32_le(self.fuel_flow);
10949 __tmp.put_f32_le(self.engine_load);
10950 __tmp.put_f32_le(self.throttle_position);
10951 __tmp.put_f32_le(self.spark_dwell_time);
10952 __tmp.put_f32_le(self.barometric_pressure);
10953 __tmp.put_f32_le(self.intake_manifold_pressure);
10954 __tmp.put_f32_le(self.intake_manifold_temperature);
10955 __tmp.put_f32_le(self.cylinder_head_temperature);
10956 __tmp.put_f32_le(self.ignition_timing);
10957 __tmp.put_f32_le(self.injection_time);
10958 __tmp.put_f32_le(self.exhaust_gas_temperature);
10959 __tmp.put_f32_le(self.throttle_out);
10960 __tmp.put_f32_le(self.pt_compensation);
10961 __tmp.put_u8(self.health);
10962 if matches!(version, MavlinkVersion::V2) {
10963 __tmp.put_f32_le(self.ignition_voltage);
10964 __tmp.put_f32_le(self.fuel_pressure);
10965 let len = __tmp.len();
10966 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
10967 } else {
10968 __tmp.len()
10969 }
10970 }
10971}
10972#[doc = "Data packet for images sent using the Image Transmission Protocol: <https://mavlink.io/en/services/image_transmission.html>."]
10973#[doc = ""]
10974#[doc = "ID: 131"]
10975#[derive(Debug, Clone, PartialEq)]
10976#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
10977#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
10978pub struct ENCAPSULATED_DATA_DATA {
10979 #[doc = "sequence number (starting with 0 on every transmission)"]
10980 pub seqnr: u16,
10981 #[doc = "image data bytes"]
10982 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
10983 pub data: [u8; 253],
10984}
10985impl ENCAPSULATED_DATA_DATA {
10986 pub const ENCODED_LEN: usize = 255usize;
10987 pub const DEFAULT: Self = Self {
10988 seqnr: 0_u16,
10989 data: [0_u8; 253usize],
10990 };
10991 #[cfg(feature = "arbitrary")]
10992 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
10993 use arbitrary::{Arbitrary, Unstructured};
10994 let mut buf = [0u8; 1024];
10995 rng.fill_bytes(&mut buf);
10996 let mut unstructured = Unstructured::new(&buf);
10997 Self::arbitrary(&mut unstructured).unwrap_or_default()
10998 }
10999}
11000impl Default for ENCAPSULATED_DATA_DATA {
11001 fn default() -> Self {
11002 Self::DEFAULT.clone()
11003 }
11004}
11005impl MessageData for ENCAPSULATED_DATA_DATA {
11006 type Message = MavMessage;
11007 const ID: u32 = 131u32;
11008 const NAME: &'static str = "ENCAPSULATED_DATA";
11009 const EXTRA_CRC: u8 = 223u8;
11010 const ENCODED_LEN: usize = 255usize;
11011 fn deser(
11012 _version: MavlinkVersion,
11013 __input: &[u8],
11014 ) -> Result<Self, ::mavlink_core::error::ParserError> {
11015 let avail_len = __input.len();
11016 let mut payload_buf = [0; Self::ENCODED_LEN];
11017 let mut buf = if avail_len < Self::ENCODED_LEN {
11018 payload_buf[0..avail_len].copy_from_slice(__input);
11019 Bytes::new(&payload_buf)
11020 } else {
11021 Bytes::new(__input)
11022 };
11023 let mut __struct = Self::default();
11024 __struct.seqnr = buf.get_u16_le();
11025 for v in &mut __struct.data {
11026 let val = buf.get_u8();
11027 *v = val;
11028 }
11029 Ok(__struct)
11030 }
11031 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
11032 let mut __tmp = BytesMut::new(bytes);
11033 #[allow(clippy::absurd_extreme_comparisons)]
11034 #[allow(unused_comparisons)]
11035 if __tmp.remaining() < Self::ENCODED_LEN {
11036 panic!(
11037 "buffer is too small (need {} bytes, but got {})",
11038 Self::ENCODED_LEN,
11039 __tmp.remaining(),
11040 )
11041 }
11042 __tmp.put_u16_le(self.seqnr);
11043 for val in &self.data {
11044 __tmp.put_u8(*val);
11045 }
11046 if matches!(version, MavlinkVersion::V2) {
11047 let len = __tmp.len();
11048 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
11049 } else {
11050 __tmp.len()
11051 }
11052 }
11053}
11054#[doc = "ESC information for lower rate streaming. Recommended streaming rate 1Hz. See ESC_STATUS for higher-rate ESC data."]
11055#[doc = ""]
11056#[doc = "ID: 290"]
11057#[derive(Debug, Clone, PartialEq)]
11058#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
11059#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
11060pub struct ESC_INFO_DATA {
11061 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude the number."]
11062 pub time_usec: u64,
11063 #[doc = "Number of reported errors by each ESC since boot."]
11064 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
11065 pub error_count: [u32; 4],
11066 #[doc = "Counter of data packets received."]
11067 pub counter: u16,
11068 #[doc = "Bitmap of ESC failure flags."]
11069 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
11070 pub failure_flags: [u16; 4],
11071 #[doc = "Temperature of each ESC. INT16_MAX: if data not supplied by ESC."]
11072 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
11073 pub temperature: [i16; 4],
11074 #[doc = "Index of the first ESC in this message. minValue = 0, maxValue = 60, increment = 4."]
11075 pub index: u8,
11076 #[doc = "Total number of ESCs in all messages of this type. Message fields with an index higher than this should be ignored because they contain invalid data."]
11077 pub count: u8,
11078 #[doc = "Connection type protocol for all ESC."]
11079 pub connection_type: EscConnectionType,
11080 #[doc = "Information regarding online/offline status of each ESC."]
11081 pub info: u8,
11082}
11083impl ESC_INFO_DATA {
11084 pub const ENCODED_LEN: usize = 46usize;
11085 pub const DEFAULT: Self = Self {
11086 time_usec: 0_u64,
11087 error_count: [0_u32; 4usize],
11088 counter: 0_u16,
11089 failure_flags: [0_u16; 4usize],
11090 temperature: [0_i16; 4usize],
11091 index: 0_u8,
11092 count: 0_u8,
11093 connection_type: EscConnectionType::DEFAULT,
11094 info: 0_u8,
11095 };
11096 #[cfg(feature = "arbitrary")]
11097 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
11098 use arbitrary::{Arbitrary, Unstructured};
11099 let mut buf = [0u8; 1024];
11100 rng.fill_bytes(&mut buf);
11101 let mut unstructured = Unstructured::new(&buf);
11102 Self::arbitrary(&mut unstructured).unwrap_or_default()
11103 }
11104}
11105impl Default for ESC_INFO_DATA {
11106 fn default() -> Self {
11107 Self::DEFAULT.clone()
11108 }
11109}
11110impl MessageData for ESC_INFO_DATA {
11111 type Message = MavMessage;
11112 const ID: u32 = 290u32;
11113 const NAME: &'static str = "ESC_INFO";
11114 const EXTRA_CRC: u8 = 251u8;
11115 const ENCODED_LEN: usize = 46usize;
11116 fn deser(
11117 _version: MavlinkVersion,
11118 __input: &[u8],
11119 ) -> Result<Self, ::mavlink_core::error::ParserError> {
11120 let avail_len = __input.len();
11121 let mut payload_buf = [0; Self::ENCODED_LEN];
11122 let mut buf = if avail_len < Self::ENCODED_LEN {
11123 payload_buf[0..avail_len].copy_from_slice(__input);
11124 Bytes::new(&payload_buf)
11125 } else {
11126 Bytes::new(__input)
11127 };
11128 let mut __struct = Self::default();
11129 __struct.time_usec = buf.get_u64_le();
11130 for v in &mut __struct.error_count {
11131 let val = buf.get_u32_le();
11132 *v = val;
11133 }
11134 __struct.counter = buf.get_u16_le();
11135 for v in &mut __struct.failure_flags {
11136 let val = buf.get_u16_le();
11137 *v = val;
11138 }
11139 for v in &mut __struct.temperature {
11140 let val = buf.get_i16_le();
11141 *v = val;
11142 }
11143 __struct.index = buf.get_u8();
11144 __struct.count = buf.get_u8();
11145 let tmp = buf.get_u8();
11146 __struct.connection_type =
11147 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
11148 enum_type: "EscConnectionType",
11149 value: tmp as u32,
11150 })?;
11151 __struct.info = buf.get_u8();
11152 Ok(__struct)
11153 }
11154 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
11155 let mut __tmp = BytesMut::new(bytes);
11156 #[allow(clippy::absurd_extreme_comparisons)]
11157 #[allow(unused_comparisons)]
11158 if __tmp.remaining() < Self::ENCODED_LEN {
11159 panic!(
11160 "buffer is too small (need {} bytes, but got {})",
11161 Self::ENCODED_LEN,
11162 __tmp.remaining(),
11163 )
11164 }
11165 __tmp.put_u64_le(self.time_usec);
11166 for val in &self.error_count {
11167 __tmp.put_u32_le(*val);
11168 }
11169 __tmp.put_u16_le(self.counter);
11170 for val in &self.failure_flags {
11171 __tmp.put_u16_le(*val);
11172 }
11173 for val in &self.temperature {
11174 __tmp.put_i16_le(*val);
11175 }
11176 __tmp.put_u8(self.index);
11177 __tmp.put_u8(self.count);
11178 __tmp.put_u8(self.connection_type as u8);
11179 __tmp.put_u8(self.info);
11180 if matches!(version, MavlinkVersion::V2) {
11181 let len = __tmp.len();
11182 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
11183 } else {
11184 __tmp.len()
11185 }
11186 }
11187}
11188#[doc = "ESC information for higher rate streaming. Recommended streaming rate is ~10 Hz. Information that changes more slowly is sent in ESC_INFO. It should typically only be streamed on high-bandwidth links (i.e. to a companion computer)."]
11189#[doc = ""]
11190#[doc = "ID: 291"]
11191#[derive(Debug, Clone, PartialEq)]
11192#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
11193#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
11194pub struct ESC_STATUS_DATA {
11195 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude the number."]
11196 pub time_usec: u64,
11197 #[doc = "Reported motor RPM from each ESC (negative for reverse rotation)."]
11198 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
11199 pub rpm: [i32; 4],
11200 #[doc = "Voltage measured from each ESC."]
11201 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
11202 pub voltage: [f32; 4],
11203 #[doc = "Current measured from each ESC."]
11204 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
11205 pub current: [f32; 4],
11206 #[doc = "Index of the first ESC in this message. minValue = 0, maxValue = 60, increment = 4."]
11207 pub index: u8,
11208}
11209impl ESC_STATUS_DATA {
11210 pub const ENCODED_LEN: usize = 57usize;
11211 pub const DEFAULT: Self = Self {
11212 time_usec: 0_u64,
11213 rpm: [0_i32; 4usize],
11214 voltage: [0.0_f32; 4usize],
11215 current: [0.0_f32; 4usize],
11216 index: 0_u8,
11217 };
11218 #[cfg(feature = "arbitrary")]
11219 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
11220 use arbitrary::{Arbitrary, Unstructured};
11221 let mut buf = [0u8; 1024];
11222 rng.fill_bytes(&mut buf);
11223 let mut unstructured = Unstructured::new(&buf);
11224 Self::arbitrary(&mut unstructured).unwrap_or_default()
11225 }
11226}
11227impl Default for ESC_STATUS_DATA {
11228 fn default() -> Self {
11229 Self::DEFAULT.clone()
11230 }
11231}
11232impl MessageData for ESC_STATUS_DATA {
11233 type Message = MavMessage;
11234 const ID: u32 = 291u32;
11235 const NAME: &'static str = "ESC_STATUS";
11236 const EXTRA_CRC: u8 = 10u8;
11237 const ENCODED_LEN: usize = 57usize;
11238 fn deser(
11239 _version: MavlinkVersion,
11240 __input: &[u8],
11241 ) -> Result<Self, ::mavlink_core::error::ParserError> {
11242 let avail_len = __input.len();
11243 let mut payload_buf = [0; Self::ENCODED_LEN];
11244 let mut buf = if avail_len < Self::ENCODED_LEN {
11245 payload_buf[0..avail_len].copy_from_slice(__input);
11246 Bytes::new(&payload_buf)
11247 } else {
11248 Bytes::new(__input)
11249 };
11250 let mut __struct = Self::default();
11251 __struct.time_usec = buf.get_u64_le();
11252 for v in &mut __struct.rpm {
11253 let val = buf.get_i32_le();
11254 *v = val;
11255 }
11256 for v in &mut __struct.voltage {
11257 let val = buf.get_f32_le();
11258 *v = val;
11259 }
11260 for v in &mut __struct.current {
11261 let val = buf.get_f32_le();
11262 *v = val;
11263 }
11264 __struct.index = buf.get_u8();
11265 Ok(__struct)
11266 }
11267 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
11268 let mut __tmp = BytesMut::new(bytes);
11269 #[allow(clippy::absurd_extreme_comparisons)]
11270 #[allow(unused_comparisons)]
11271 if __tmp.remaining() < Self::ENCODED_LEN {
11272 panic!(
11273 "buffer is too small (need {} bytes, but got {})",
11274 Self::ENCODED_LEN,
11275 __tmp.remaining(),
11276 )
11277 }
11278 __tmp.put_u64_le(self.time_usec);
11279 for val in &self.rpm {
11280 __tmp.put_i32_le(*val);
11281 }
11282 for val in &self.voltage {
11283 __tmp.put_f32_le(*val);
11284 }
11285 for val in &self.current {
11286 __tmp.put_f32_le(*val);
11287 }
11288 __tmp.put_u8(self.index);
11289 if matches!(version, MavlinkVersion::V2) {
11290 let len = __tmp.len();
11291 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
11292 } else {
11293 __tmp.len()
11294 }
11295 }
11296}
11297#[doc = "Estimator status message including flags, innovation test ratios and estimated accuracies. The flags message is an integer bitmask containing information on which EKF outputs are valid. See the ESTIMATOR_STATUS_FLAGS enum definition for further information. The innovation test ratios show the magnitude of the sensor innovation divided by the innovation check threshold. Under normal operation the innovation test ratios should be below 0.5 with occasional values up to 1.0. Values greater than 1.0 should be rare under normal operation and indicate that a measurement has been rejected by the filter. The user should be notified if an innovation test ratio greater than 1.0 is recorded. Notifications for values in the range between 0.5 and 1.0 should be optional and controllable by the user."]
11298#[doc = ""]
11299#[doc = "ID: 230"]
11300#[derive(Debug, Clone, PartialEq)]
11301#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
11302#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
11303pub struct ESTIMATOR_STATUS_DATA {
11304 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
11305 pub time_usec: u64,
11306 #[doc = "Velocity innovation test ratio"]
11307 pub vel_ratio: f32,
11308 #[doc = "Horizontal position innovation test ratio"]
11309 pub pos_horiz_ratio: f32,
11310 #[doc = "Vertical position innovation test ratio"]
11311 pub pos_vert_ratio: f32,
11312 #[doc = "Magnetometer innovation test ratio"]
11313 pub mag_ratio: f32,
11314 #[doc = "Height above terrain innovation test ratio"]
11315 pub hagl_ratio: f32,
11316 #[doc = "True airspeed innovation test ratio"]
11317 pub tas_ratio: f32,
11318 #[doc = "Horizontal position 1-STD accuracy relative to the EKF local origin"]
11319 pub pos_horiz_accuracy: f32,
11320 #[doc = "Vertical position 1-STD accuracy relative to the EKF local origin"]
11321 pub pos_vert_accuracy: f32,
11322 #[doc = "Bitmap indicating which EKF outputs are valid."]
11323 pub flags: EstimatorStatusFlags,
11324}
11325impl ESTIMATOR_STATUS_DATA {
11326 pub const ENCODED_LEN: usize = 42usize;
11327 pub const DEFAULT: Self = Self {
11328 time_usec: 0_u64,
11329 vel_ratio: 0.0_f32,
11330 pos_horiz_ratio: 0.0_f32,
11331 pos_vert_ratio: 0.0_f32,
11332 mag_ratio: 0.0_f32,
11333 hagl_ratio: 0.0_f32,
11334 tas_ratio: 0.0_f32,
11335 pos_horiz_accuracy: 0.0_f32,
11336 pos_vert_accuracy: 0.0_f32,
11337 flags: EstimatorStatusFlags::DEFAULT,
11338 };
11339 #[cfg(feature = "arbitrary")]
11340 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
11341 use arbitrary::{Arbitrary, Unstructured};
11342 let mut buf = [0u8; 1024];
11343 rng.fill_bytes(&mut buf);
11344 let mut unstructured = Unstructured::new(&buf);
11345 Self::arbitrary(&mut unstructured).unwrap_or_default()
11346 }
11347}
11348impl Default for ESTIMATOR_STATUS_DATA {
11349 fn default() -> Self {
11350 Self::DEFAULT.clone()
11351 }
11352}
11353impl MessageData for ESTIMATOR_STATUS_DATA {
11354 type Message = MavMessage;
11355 const ID: u32 = 230u32;
11356 const NAME: &'static str = "ESTIMATOR_STATUS";
11357 const EXTRA_CRC: u8 = 163u8;
11358 const ENCODED_LEN: usize = 42usize;
11359 fn deser(
11360 _version: MavlinkVersion,
11361 __input: &[u8],
11362 ) -> Result<Self, ::mavlink_core::error::ParserError> {
11363 let avail_len = __input.len();
11364 let mut payload_buf = [0; Self::ENCODED_LEN];
11365 let mut buf = if avail_len < Self::ENCODED_LEN {
11366 payload_buf[0..avail_len].copy_from_slice(__input);
11367 Bytes::new(&payload_buf)
11368 } else {
11369 Bytes::new(__input)
11370 };
11371 let mut __struct = Self::default();
11372 __struct.time_usec = buf.get_u64_le();
11373 __struct.vel_ratio = buf.get_f32_le();
11374 __struct.pos_horiz_ratio = buf.get_f32_le();
11375 __struct.pos_vert_ratio = buf.get_f32_le();
11376 __struct.mag_ratio = buf.get_f32_le();
11377 __struct.hagl_ratio = buf.get_f32_le();
11378 __struct.tas_ratio = buf.get_f32_le();
11379 __struct.pos_horiz_accuracy = buf.get_f32_le();
11380 __struct.pos_vert_accuracy = buf.get_f32_le();
11381 let tmp = buf.get_u16_le();
11382 __struct.flags = EstimatorStatusFlags::from_bits(tmp & EstimatorStatusFlags::all().bits())
11383 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
11384 flag_type: "EstimatorStatusFlags",
11385 value: tmp as u32,
11386 })?;
11387 Ok(__struct)
11388 }
11389 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
11390 let mut __tmp = BytesMut::new(bytes);
11391 #[allow(clippy::absurd_extreme_comparisons)]
11392 #[allow(unused_comparisons)]
11393 if __tmp.remaining() < Self::ENCODED_LEN {
11394 panic!(
11395 "buffer is too small (need {} bytes, but got {})",
11396 Self::ENCODED_LEN,
11397 __tmp.remaining(),
11398 )
11399 }
11400 __tmp.put_u64_le(self.time_usec);
11401 __tmp.put_f32_le(self.vel_ratio);
11402 __tmp.put_f32_le(self.pos_horiz_ratio);
11403 __tmp.put_f32_le(self.pos_vert_ratio);
11404 __tmp.put_f32_le(self.mag_ratio);
11405 __tmp.put_f32_le(self.hagl_ratio);
11406 __tmp.put_f32_le(self.tas_ratio);
11407 __tmp.put_f32_le(self.pos_horiz_accuracy);
11408 __tmp.put_f32_le(self.pos_vert_accuracy);
11409 __tmp.put_u16_le(self.flags.bits());
11410 if matches!(version, MavlinkVersion::V2) {
11411 let len = __tmp.len();
11412 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
11413 } else {
11414 __tmp.len()
11415 }
11416 }
11417}
11418#[doc = "Event message. Each new event from a particular component gets a new sequence number. The same message might be sent multiple times if (re-)requested. Most events are broadcast, some can be specific to a target component (as receivers keep track of the sequence for missed events, all events need to be broadcast. Thus we use destination_component instead of target_component)."]
11419#[doc = ""]
11420#[doc = "ID: 410"]
11421#[derive(Debug, Clone, PartialEq)]
11422#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
11423#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
11424pub struct EVENT_DATA {
11425 #[doc = "Event ID (as defined in the component metadata)"]
11426 pub id: u32,
11427 #[doc = "Timestamp (time since system boot when the event happened)."]
11428 pub event_time_boot_ms: u32,
11429 #[doc = "Sequence number."]
11430 pub sequence: u16,
11431 #[doc = "Component ID"]
11432 pub destination_component: u8,
11433 #[doc = "System ID"]
11434 pub destination_system: u8,
11435 #[doc = "Log levels: 4 bits MSB: internal (for logging purposes), 4 bits LSB: external. Levels: Emergency = 0, Alert = 1, Critical = 2, Error = 3, Warning = 4, Notice = 5, Info = 6, Debug = 7, Protocol = 8, Disabled = 9"]
11436 pub log_levels: u8,
11437 #[doc = "Arguments (depend on event ID)."]
11438 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
11439 pub arguments: [u8; 40],
11440}
11441impl EVENT_DATA {
11442 pub const ENCODED_LEN: usize = 53usize;
11443 pub const DEFAULT: Self = Self {
11444 id: 0_u32,
11445 event_time_boot_ms: 0_u32,
11446 sequence: 0_u16,
11447 destination_component: 0_u8,
11448 destination_system: 0_u8,
11449 log_levels: 0_u8,
11450 arguments: [0_u8; 40usize],
11451 };
11452 #[cfg(feature = "arbitrary")]
11453 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
11454 use arbitrary::{Arbitrary, Unstructured};
11455 let mut buf = [0u8; 1024];
11456 rng.fill_bytes(&mut buf);
11457 let mut unstructured = Unstructured::new(&buf);
11458 Self::arbitrary(&mut unstructured).unwrap_or_default()
11459 }
11460}
11461impl Default for EVENT_DATA {
11462 fn default() -> Self {
11463 Self::DEFAULT.clone()
11464 }
11465}
11466impl MessageData for EVENT_DATA {
11467 type Message = MavMessage;
11468 const ID: u32 = 410u32;
11469 const NAME: &'static str = "EVENT";
11470 const EXTRA_CRC: u8 = 160u8;
11471 const ENCODED_LEN: usize = 53usize;
11472 fn deser(
11473 _version: MavlinkVersion,
11474 __input: &[u8],
11475 ) -> Result<Self, ::mavlink_core::error::ParserError> {
11476 let avail_len = __input.len();
11477 let mut payload_buf = [0; Self::ENCODED_LEN];
11478 let mut buf = if avail_len < Self::ENCODED_LEN {
11479 payload_buf[0..avail_len].copy_from_slice(__input);
11480 Bytes::new(&payload_buf)
11481 } else {
11482 Bytes::new(__input)
11483 };
11484 let mut __struct = Self::default();
11485 __struct.id = buf.get_u32_le();
11486 __struct.event_time_boot_ms = buf.get_u32_le();
11487 __struct.sequence = buf.get_u16_le();
11488 __struct.destination_component = buf.get_u8();
11489 __struct.destination_system = buf.get_u8();
11490 __struct.log_levels = buf.get_u8();
11491 for v in &mut __struct.arguments {
11492 let val = buf.get_u8();
11493 *v = val;
11494 }
11495 Ok(__struct)
11496 }
11497 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
11498 let mut __tmp = BytesMut::new(bytes);
11499 #[allow(clippy::absurd_extreme_comparisons)]
11500 #[allow(unused_comparisons)]
11501 if __tmp.remaining() < Self::ENCODED_LEN {
11502 panic!(
11503 "buffer is too small (need {} bytes, but got {})",
11504 Self::ENCODED_LEN,
11505 __tmp.remaining(),
11506 )
11507 }
11508 __tmp.put_u32_le(self.id);
11509 __tmp.put_u32_le(self.event_time_boot_ms);
11510 __tmp.put_u16_le(self.sequence);
11511 __tmp.put_u8(self.destination_component);
11512 __tmp.put_u8(self.destination_system);
11513 __tmp.put_u8(self.log_levels);
11514 for val in &self.arguments {
11515 __tmp.put_u8(*val);
11516 }
11517 if matches!(version, MavlinkVersion::V2) {
11518 let len = __tmp.len();
11519 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
11520 } else {
11521 __tmp.len()
11522 }
11523 }
11524}
11525#[doc = "Provides state for additional features."]
11526#[doc = ""]
11527#[doc = "ID: 245"]
11528#[derive(Debug, Clone, PartialEq)]
11529#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
11530#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
11531pub struct EXTENDED_SYS_STATE_DATA {
11532 #[doc = "The VTOL state if applicable. Is set to MAV_VTOL_STATE_UNDEFINED if UAV is not in VTOL configuration."]
11533 pub vtol_state: MavVtolState,
11534 #[doc = "The landed state. Is set to MAV_LANDED_STATE_UNDEFINED if landed state is unknown."]
11535 pub landed_state: MavLandedState,
11536}
11537impl EXTENDED_SYS_STATE_DATA {
11538 pub const ENCODED_LEN: usize = 2usize;
11539 pub const DEFAULT: Self = Self {
11540 vtol_state: MavVtolState::DEFAULT,
11541 landed_state: MavLandedState::DEFAULT,
11542 };
11543 #[cfg(feature = "arbitrary")]
11544 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
11545 use arbitrary::{Arbitrary, Unstructured};
11546 let mut buf = [0u8; 1024];
11547 rng.fill_bytes(&mut buf);
11548 let mut unstructured = Unstructured::new(&buf);
11549 Self::arbitrary(&mut unstructured).unwrap_or_default()
11550 }
11551}
11552impl Default for EXTENDED_SYS_STATE_DATA {
11553 fn default() -> Self {
11554 Self::DEFAULT.clone()
11555 }
11556}
11557impl MessageData for EXTENDED_SYS_STATE_DATA {
11558 type Message = MavMessage;
11559 const ID: u32 = 245u32;
11560 const NAME: &'static str = "EXTENDED_SYS_STATE";
11561 const EXTRA_CRC: u8 = 130u8;
11562 const ENCODED_LEN: usize = 2usize;
11563 fn deser(
11564 _version: MavlinkVersion,
11565 __input: &[u8],
11566 ) -> Result<Self, ::mavlink_core::error::ParserError> {
11567 let avail_len = __input.len();
11568 let mut payload_buf = [0; Self::ENCODED_LEN];
11569 let mut buf = if avail_len < Self::ENCODED_LEN {
11570 payload_buf[0..avail_len].copy_from_slice(__input);
11571 Bytes::new(&payload_buf)
11572 } else {
11573 Bytes::new(__input)
11574 };
11575 let mut __struct = Self::default();
11576 let tmp = buf.get_u8();
11577 __struct.vtol_state =
11578 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
11579 enum_type: "MavVtolState",
11580 value: tmp as u32,
11581 })?;
11582 let tmp = buf.get_u8();
11583 __struct.landed_state =
11584 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
11585 enum_type: "MavLandedState",
11586 value: tmp as u32,
11587 })?;
11588 Ok(__struct)
11589 }
11590 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
11591 let mut __tmp = BytesMut::new(bytes);
11592 #[allow(clippy::absurd_extreme_comparisons)]
11593 #[allow(unused_comparisons)]
11594 if __tmp.remaining() < Self::ENCODED_LEN {
11595 panic!(
11596 "buffer is too small (need {} bytes, but got {})",
11597 Self::ENCODED_LEN,
11598 __tmp.remaining(),
11599 )
11600 }
11601 __tmp.put_u8(self.vtol_state as u8);
11602 __tmp.put_u8(self.landed_state as u8);
11603 if matches!(version, MavlinkVersion::V2) {
11604 let len = __tmp.len();
11605 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
11606 } else {
11607 __tmp.len()
11608 }
11609 }
11610}
11611#[doc = "Status of geo-fencing. Sent in extended status stream when fencing enabled."]
11612#[doc = ""]
11613#[doc = "ID: 162"]
11614#[derive(Debug, Clone, PartialEq)]
11615#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
11616#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
11617pub struct FENCE_STATUS_DATA {
11618 #[doc = "Time (since boot) of last breach."]
11619 pub breach_time: u32,
11620 #[doc = "Number of fence breaches."]
11621 pub breach_count: u16,
11622 #[doc = "Breach status (0 if currently inside fence, 1 if outside)."]
11623 pub breach_status: u8,
11624 #[doc = "Last breach type."]
11625 pub breach_type: FenceBreach,
11626 #[doc = "Active action to prevent fence breach"]
11627 #[cfg_attr(feature = "serde", serde(default))]
11628 pub breach_mitigation: FenceMitigate,
11629}
11630impl FENCE_STATUS_DATA {
11631 pub const ENCODED_LEN: usize = 9usize;
11632 pub const DEFAULT: Self = Self {
11633 breach_time: 0_u32,
11634 breach_count: 0_u16,
11635 breach_status: 0_u8,
11636 breach_type: FenceBreach::DEFAULT,
11637 breach_mitigation: FenceMitigate::DEFAULT,
11638 };
11639 #[cfg(feature = "arbitrary")]
11640 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
11641 use arbitrary::{Arbitrary, Unstructured};
11642 let mut buf = [0u8; 1024];
11643 rng.fill_bytes(&mut buf);
11644 let mut unstructured = Unstructured::new(&buf);
11645 Self::arbitrary(&mut unstructured).unwrap_or_default()
11646 }
11647}
11648impl Default for FENCE_STATUS_DATA {
11649 fn default() -> Self {
11650 Self::DEFAULT.clone()
11651 }
11652}
11653impl MessageData for FENCE_STATUS_DATA {
11654 type Message = MavMessage;
11655 const ID: u32 = 162u32;
11656 const NAME: &'static str = "FENCE_STATUS";
11657 const EXTRA_CRC: u8 = 189u8;
11658 const ENCODED_LEN: usize = 9usize;
11659 fn deser(
11660 _version: MavlinkVersion,
11661 __input: &[u8],
11662 ) -> Result<Self, ::mavlink_core::error::ParserError> {
11663 let avail_len = __input.len();
11664 let mut payload_buf = [0; Self::ENCODED_LEN];
11665 let mut buf = if avail_len < Self::ENCODED_LEN {
11666 payload_buf[0..avail_len].copy_from_slice(__input);
11667 Bytes::new(&payload_buf)
11668 } else {
11669 Bytes::new(__input)
11670 };
11671 let mut __struct = Self::default();
11672 __struct.breach_time = buf.get_u32_le();
11673 __struct.breach_count = buf.get_u16_le();
11674 __struct.breach_status = buf.get_u8();
11675 let tmp = buf.get_u8();
11676 __struct.breach_type =
11677 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
11678 enum_type: "FenceBreach",
11679 value: tmp as u32,
11680 })?;
11681 let tmp = buf.get_u8();
11682 __struct.breach_mitigation =
11683 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
11684 enum_type: "FenceMitigate",
11685 value: tmp as u32,
11686 })?;
11687 Ok(__struct)
11688 }
11689 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
11690 let mut __tmp = BytesMut::new(bytes);
11691 #[allow(clippy::absurd_extreme_comparisons)]
11692 #[allow(unused_comparisons)]
11693 if __tmp.remaining() < Self::ENCODED_LEN {
11694 panic!(
11695 "buffer is too small (need {} bytes, but got {})",
11696 Self::ENCODED_LEN,
11697 __tmp.remaining(),
11698 )
11699 }
11700 __tmp.put_u32_le(self.breach_time);
11701 __tmp.put_u16_le(self.breach_count);
11702 __tmp.put_u8(self.breach_status);
11703 __tmp.put_u8(self.breach_type as u8);
11704 if matches!(version, MavlinkVersion::V2) {
11705 __tmp.put_u8(self.breach_mitigation as u8);
11706 let len = __tmp.len();
11707 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
11708 } else {
11709 __tmp.len()
11710 }
11711 }
11712}
11713#[doc = "File transfer protocol message: <https://mavlink.io/en/services/ftp.html>."]
11714#[doc = ""]
11715#[doc = "ID: 110"]
11716#[derive(Debug, Clone, PartialEq)]
11717#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
11718#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
11719pub struct FILE_TRANSFER_PROTOCOL_DATA {
11720 #[doc = "Network ID (0 for broadcast)"]
11721 pub target_network: u8,
11722 #[doc = "System ID (0 for broadcast)"]
11723 pub target_system: u8,
11724 #[doc = "Component ID (0 for broadcast)"]
11725 pub target_component: u8,
11726 #[doc = "Variable length payload. The length is defined by the remaining message length when subtracting the header and other fields. The content/format of this block is defined in <https://mavlink.io/en/services/ftp.html>."]
11727 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
11728 pub payload: [u8; 251],
11729}
11730impl FILE_TRANSFER_PROTOCOL_DATA {
11731 pub const ENCODED_LEN: usize = 254usize;
11732 pub const DEFAULT: Self = Self {
11733 target_network: 0_u8,
11734 target_system: 0_u8,
11735 target_component: 0_u8,
11736 payload: [0_u8; 251usize],
11737 };
11738 #[cfg(feature = "arbitrary")]
11739 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
11740 use arbitrary::{Arbitrary, Unstructured};
11741 let mut buf = [0u8; 1024];
11742 rng.fill_bytes(&mut buf);
11743 let mut unstructured = Unstructured::new(&buf);
11744 Self::arbitrary(&mut unstructured).unwrap_or_default()
11745 }
11746}
11747impl Default for FILE_TRANSFER_PROTOCOL_DATA {
11748 fn default() -> Self {
11749 Self::DEFAULT.clone()
11750 }
11751}
11752impl MessageData for FILE_TRANSFER_PROTOCOL_DATA {
11753 type Message = MavMessage;
11754 const ID: u32 = 110u32;
11755 const NAME: &'static str = "FILE_TRANSFER_PROTOCOL";
11756 const EXTRA_CRC: u8 = 84u8;
11757 const ENCODED_LEN: usize = 254usize;
11758 fn deser(
11759 _version: MavlinkVersion,
11760 __input: &[u8],
11761 ) -> Result<Self, ::mavlink_core::error::ParserError> {
11762 let avail_len = __input.len();
11763 let mut payload_buf = [0; Self::ENCODED_LEN];
11764 let mut buf = if avail_len < Self::ENCODED_LEN {
11765 payload_buf[0..avail_len].copy_from_slice(__input);
11766 Bytes::new(&payload_buf)
11767 } else {
11768 Bytes::new(__input)
11769 };
11770 let mut __struct = Self::default();
11771 __struct.target_network = buf.get_u8();
11772 __struct.target_system = buf.get_u8();
11773 __struct.target_component = buf.get_u8();
11774 for v in &mut __struct.payload {
11775 let val = buf.get_u8();
11776 *v = val;
11777 }
11778 Ok(__struct)
11779 }
11780 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
11781 let mut __tmp = BytesMut::new(bytes);
11782 #[allow(clippy::absurd_extreme_comparisons)]
11783 #[allow(unused_comparisons)]
11784 if __tmp.remaining() < Self::ENCODED_LEN {
11785 panic!(
11786 "buffer is too small (need {} bytes, but got {})",
11787 Self::ENCODED_LEN,
11788 __tmp.remaining(),
11789 )
11790 }
11791 __tmp.put_u8(self.target_network);
11792 __tmp.put_u8(self.target_system);
11793 __tmp.put_u8(self.target_component);
11794 for val in &self.payload {
11795 __tmp.put_u8(*val);
11796 }
11797 if matches!(version, MavlinkVersion::V2) {
11798 let len = __tmp.len();
11799 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
11800 } else {
11801 __tmp.len()
11802 }
11803 }
11804}
11805#[doc = "Flight information. This includes time since boot for arm, takeoff, and land, and a flight number. Takeoff and landing values reset to zero on arm. This can be requested using MAV_CMD_REQUEST_MESSAGE. Note, some fields are misnamed - timestamps are from boot (not UTC) and the flight_uuid is a sequence number."]
11806#[doc = ""]
11807#[doc = "ID: 264"]
11808#[derive(Debug, Clone, PartialEq)]
11809#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
11810#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
11811pub struct FLIGHT_INFORMATION_DATA {
11812 #[doc = "Timestamp at arming (since system boot). Set to 0 on boot. Set value on arming. Note, field is misnamed UTC."]
11813 pub arming_time_utc: u64,
11814 #[doc = "Timestamp at takeoff (since system boot). Set to 0 at boot and on arming. Note, field is misnamed UTC."]
11815 pub takeoff_time_utc: u64,
11816 #[doc = "Flight number. Note, field is misnamed UUID."]
11817 pub flight_uuid: u64,
11818 #[doc = "Timestamp (time since system boot)."]
11819 pub time_boot_ms: u32,
11820 #[doc = "Timestamp at landing (in ms since system boot). Set to 0 at boot and on arming."]
11821 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
11822 pub landing_time: u32,
11823}
11824impl FLIGHT_INFORMATION_DATA {
11825 pub const ENCODED_LEN: usize = 32usize;
11826 pub const DEFAULT: Self = Self {
11827 arming_time_utc: 0_u64,
11828 takeoff_time_utc: 0_u64,
11829 flight_uuid: 0_u64,
11830 time_boot_ms: 0_u32,
11831 landing_time: 0_u32,
11832 };
11833 #[cfg(feature = "arbitrary")]
11834 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
11835 use arbitrary::{Arbitrary, Unstructured};
11836 let mut buf = [0u8; 1024];
11837 rng.fill_bytes(&mut buf);
11838 let mut unstructured = Unstructured::new(&buf);
11839 Self::arbitrary(&mut unstructured).unwrap_or_default()
11840 }
11841}
11842impl Default for FLIGHT_INFORMATION_DATA {
11843 fn default() -> Self {
11844 Self::DEFAULT.clone()
11845 }
11846}
11847impl MessageData for FLIGHT_INFORMATION_DATA {
11848 type Message = MavMessage;
11849 const ID: u32 = 264u32;
11850 const NAME: &'static str = "FLIGHT_INFORMATION";
11851 const EXTRA_CRC: u8 = 49u8;
11852 const ENCODED_LEN: usize = 32usize;
11853 fn deser(
11854 _version: MavlinkVersion,
11855 __input: &[u8],
11856 ) -> Result<Self, ::mavlink_core::error::ParserError> {
11857 let avail_len = __input.len();
11858 let mut payload_buf = [0; Self::ENCODED_LEN];
11859 let mut buf = if avail_len < Self::ENCODED_LEN {
11860 payload_buf[0..avail_len].copy_from_slice(__input);
11861 Bytes::new(&payload_buf)
11862 } else {
11863 Bytes::new(__input)
11864 };
11865 let mut __struct = Self::default();
11866 __struct.arming_time_utc = buf.get_u64_le();
11867 __struct.takeoff_time_utc = buf.get_u64_le();
11868 __struct.flight_uuid = buf.get_u64_le();
11869 __struct.time_boot_ms = buf.get_u32_le();
11870 __struct.landing_time = buf.get_u32_le();
11871 Ok(__struct)
11872 }
11873 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
11874 let mut __tmp = BytesMut::new(bytes);
11875 #[allow(clippy::absurd_extreme_comparisons)]
11876 #[allow(unused_comparisons)]
11877 if __tmp.remaining() < Self::ENCODED_LEN {
11878 panic!(
11879 "buffer is too small (need {} bytes, but got {})",
11880 Self::ENCODED_LEN,
11881 __tmp.remaining(),
11882 )
11883 }
11884 __tmp.put_u64_le(self.arming_time_utc);
11885 __tmp.put_u64_le(self.takeoff_time_utc);
11886 __tmp.put_u64_le(self.flight_uuid);
11887 __tmp.put_u32_le(self.time_boot_ms);
11888 if matches!(version, MavlinkVersion::V2) {
11889 __tmp.put_u32_le(self.landing_time);
11890 let len = __tmp.len();
11891 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
11892 } else {
11893 __tmp.len()
11894 }
11895 }
11896}
11897#[doc = "Current motion information from a designated system."]
11898#[doc = ""]
11899#[doc = "ID: 144"]
11900#[derive(Debug, Clone, PartialEq)]
11901#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
11902#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
11903pub struct FOLLOW_TARGET_DATA {
11904 #[doc = "Timestamp (time since system boot)."]
11905 pub timestamp: u64,
11906 #[doc = "button states or switches of a tracker device"]
11907 pub custom_state: u64,
11908 #[doc = "Latitude (WGS84)"]
11909 pub lat: i32,
11910 #[doc = "Longitude (WGS84)"]
11911 pub lon: i32,
11912 #[doc = "Altitude (MSL)"]
11913 pub alt: f32,
11914 #[doc = "target velocity (0,0,0) for unknown"]
11915 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
11916 pub vel: [f32; 3],
11917 #[doc = "linear target acceleration (0,0,0) for unknown"]
11918 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
11919 pub acc: [f32; 3],
11920 #[doc = "(0 0 0 0 for unknown)"]
11921 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
11922 pub attitude_q: [f32; 4],
11923 #[doc = "(0 0 0 for unknown)"]
11924 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
11925 pub rates: [f32; 3],
11926 #[doc = "eph epv"]
11927 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
11928 pub position_cov: [f32; 3],
11929 #[doc = "bit positions for tracker reporting capabilities (POS = 0, VEL = 1, ACCEL = 2, ATT + RATES = 3)"]
11930 pub est_capabilities: u8,
11931}
11932impl FOLLOW_TARGET_DATA {
11933 pub const ENCODED_LEN: usize = 93usize;
11934 pub const DEFAULT: Self = Self {
11935 timestamp: 0_u64,
11936 custom_state: 0_u64,
11937 lat: 0_i32,
11938 lon: 0_i32,
11939 alt: 0.0_f32,
11940 vel: [0.0_f32; 3usize],
11941 acc: [0.0_f32; 3usize],
11942 attitude_q: [0.0_f32; 4usize],
11943 rates: [0.0_f32; 3usize],
11944 position_cov: [0.0_f32; 3usize],
11945 est_capabilities: 0_u8,
11946 };
11947 #[cfg(feature = "arbitrary")]
11948 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
11949 use arbitrary::{Arbitrary, Unstructured};
11950 let mut buf = [0u8; 1024];
11951 rng.fill_bytes(&mut buf);
11952 let mut unstructured = Unstructured::new(&buf);
11953 Self::arbitrary(&mut unstructured).unwrap_or_default()
11954 }
11955}
11956impl Default for FOLLOW_TARGET_DATA {
11957 fn default() -> Self {
11958 Self::DEFAULT.clone()
11959 }
11960}
11961impl MessageData for FOLLOW_TARGET_DATA {
11962 type Message = MavMessage;
11963 const ID: u32 = 144u32;
11964 const NAME: &'static str = "FOLLOW_TARGET";
11965 const EXTRA_CRC: u8 = 127u8;
11966 const ENCODED_LEN: usize = 93usize;
11967 fn deser(
11968 _version: MavlinkVersion,
11969 __input: &[u8],
11970 ) -> Result<Self, ::mavlink_core::error::ParserError> {
11971 let avail_len = __input.len();
11972 let mut payload_buf = [0; Self::ENCODED_LEN];
11973 let mut buf = if avail_len < Self::ENCODED_LEN {
11974 payload_buf[0..avail_len].copy_from_slice(__input);
11975 Bytes::new(&payload_buf)
11976 } else {
11977 Bytes::new(__input)
11978 };
11979 let mut __struct = Self::default();
11980 __struct.timestamp = buf.get_u64_le();
11981 __struct.custom_state = buf.get_u64_le();
11982 __struct.lat = buf.get_i32_le();
11983 __struct.lon = buf.get_i32_le();
11984 __struct.alt = buf.get_f32_le();
11985 for v in &mut __struct.vel {
11986 let val = buf.get_f32_le();
11987 *v = val;
11988 }
11989 for v in &mut __struct.acc {
11990 let val = buf.get_f32_le();
11991 *v = val;
11992 }
11993 for v in &mut __struct.attitude_q {
11994 let val = buf.get_f32_le();
11995 *v = val;
11996 }
11997 for v in &mut __struct.rates {
11998 let val = buf.get_f32_le();
11999 *v = val;
12000 }
12001 for v in &mut __struct.position_cov {
12002 let val = buf.get_f32_le();
12003 *v = val;
12004 }
12005 __struct.est_capabilities = buf.get_u8();
12006 Ok(__struct)
12007 }
12008 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
12009 let mut __tmp = BytesMut::new(bytes);
12010 #[allow(clippy::absurd_extreme_comparisons)]
12011 #[allow(unused_comparisons)]
12012 if __tmp.remaining() < Self::ENCODED_LEN {
12013 panic!(
12014 "buffer is too small (need {} bytes, but got {})",
12015 Self::ENCODED_LEN,
12016 __tmp.remaining(),
12017 )
12018 }
12019 __tmp.put_u64_le(self.timestamp);
12020 __tmp.put_u64_le(self.custom_state);
12021 __tmp.put_i32_le(self.lat);
12022 __tmp.put_i32_le(self.lon);
12023 __tmp.put_f32_le(self.alt);
12024 for val in &self.vel {
12025 __tmp.put_f32_le(*val);
12026 }
12027 for val in &self.acc {
12028 __tmp.put_f32_le(*val);
12029 }
12030 for val in &self.attitude_q {
12031 __tmp.put_f32_le(*val);
12032 }
12033 for val in &self.rates {
12034 __tmp.put_f32_le(*val);
12035 }
12036 for val in &self.position_cov {
12037 __tmp.put_f32_le(*val);
12038 }
12039 __tmp.put_u8(self.est_capabilities);
12040 if matches!(version, MavlinkVersion::V2) {
12041 let len = __tmp.len();
12042 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
12043 } else {
12044 __tmp.len()
12045 }
12046 }
12047}
12048#[doc = "Fuel status. This message provides \"generic\" fuel level information for in a GCS and for triggering failsafes in an autopilot. The fuel type and associated units for fields in this message are defined in the enum MAV_FUEL_TYPE. The reported `consumed_fuel` and `remaining_fuel` must only be supplied if measured: they must not be inferred from the `maximum_fuel` and the other value. A recipient can assume that if these fields are supplied they are accurate. If not provided, the recipient can infer `remaining_fuel` from `maximum_fuel` and `consumed_fuel` on the assumption that the fuel was initially at its maximum (this is what battery monitors assume). Note however that this is an assumption, and the UI should prompt the user appropriately (i.e. notify user that they should fill the tank before boot). This kind of information may also be sent in fuel-specific messages such as BATTERY_STATUS_V2. If both messages are sent for the same fuel system, the ids and corresponding information must match. This should be streamed (nominally at 0.1 Hz)."]
12049#[doc = ""]
12050#[doc = "ID: 371"]
12051#[derive(Debug, Clone, PartialEq)]
12052#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
12053#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
12054pub struct FUEL_STATUS_DATA {
12055 #[doc = "Capacity when full. Must be provided."]
12056 pub maximum_fuel: f32,
12057 #[doc = "Consumed fuel (measured). This value should not be inferred: if not measured set to NaN. NaN: field not provided."]
12058 pub consumed_fuel: f32,
12059 #[doc = "Remaining fuel until empty (measured). The value should not be inferred: if not measured set to NaN. NaN: field not provided."]
12060 pub remaining_fuel: f32,
12061 #[doc = "Positive value when emptying/using, and negative if filling/replacing. NaN: field not provided."]
12062 pub flow_rate: f32,
12063 #[doc = "Fuel temperature. NaN: field not provided."]
12064 pub temperature: f32,
12065 #[doc = "Fuel type. Defines units for fuel capacity and consumption fields above."]
12066 pub fuel_type: MavFuelType,
12067 #[doc = "Fuel ID. Must match ID of other messages for same fuel system, such as BATTERY_STATUS_V2."]
12068 pub id: u8,
12069 #[doc = "Percentage of remaining fuel, relative to full. Values: [0-100], UINT8_MAX: field not provided."]
12070 pub percent_remaining: u8,
12071}
12072impl FUEL_STATUS_DATA {
12073 pub const ENCODED_LEN: usize = 26usize;
12074 pub const DEFAULT: Self = Self {
12075 maximum_fuel: 0.0_f32,
12076 consumed_fuel: 0.0_f32,
12077 remaining_fuel: 0.0_f32,
12078 flow_rate: 0.0_f32,
12079 temperature: 0.0_f32,
12080 fuel_type: MavFuelType::DEFAULT,
12081 id: 0_u8,
12082 percent_remaining: 0_u8,
12083 };
12084 #[cfg(feature = "arbitrary")]
12085 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
12086 use arbitrary::{Arbitrary, Unstructured};
12087 let mut buf = [0u8; 1024];
12088 rng.fill_bytes(&mut buf);
12089 let mut unstructured = Unstructured::new(&buf);
12090 Self::arbitrary(&mut unstructured).unwrap_or_default()
12091 }
12092}
12093impl Default for FUEL_STATUS_DATA {
12094 fn default() -> Self {
12095 Self::DEFAULT.clone()
12096 }
12097}
12098impl MessageData for FUEL_STATUS_DATA {
12099 type Message = MavMessage;
12100 const ID: u32 = 371u32;
12101 const NAME: &'static str = "FUEL_STATUS";
12102 const EXTRA_CRC: u8 = 10u8;
12103 const ENCODED_LEN: usize = 26usize;
12104 fn deser(
12105 _version: MavlinkVersion,
12106 __input: &[u8],
12107 ) -> Result<Self, ::mavlink_core::error::ParserError> {
12108 let avail_len = __input.len();
12109 let mut payload_buf = [0; Self::ENCODED_LEN];
12110 let mut buf = if avail_len < Self::ENCODED_LEN {
12111 payload_buf[0..avail_len].copy_from_slice(__input);
12112 Bytes::new(&payload_buf)
12113 } else {
12114 Bytes::new(__input)
12115 };
12116 let mut __struct = Self::default();
12117 __struct.maximum_fuel = buf.get_f32_le();
12118 __struct.consumed_fuel = buf.get_f32_le();
12119 __struct.remaining_fuel = buf.get_f32_le();
12120 __struct.flow_rate = buf.get_f32_le();
12121 __struct.temperature = buf.get_f32_le();
12122 let tmp = buf.get_u32_le();
12123 __struct.fuel_type = FromPrimitive::from_u32(tmp).ok_or(
12124 ::mavlink_core::error::ParserError::InvalidEnum {
12125 enum_type: "MavFuelType",
12126 value: tmp as u32,
12127 },
12128 )?;
12129 __struct.id = buf.get_u8();
12130 __struct.percent_remaining = buf.get_u8();
12131 Ok(__struct)
12132 }
12133 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
12134 let mut __tmp = BytesMut::new(bytes);
12135 #[allow(clippy::absurd_extreme_comparisons)]
12136 #[allow(unused_comparisons)]
12137 if __tmp.remaining() < Self::ENCODED_LEN {
12138 panic!(
12139 "buffer is too small (need {} bytes, but got {})",
12140 Self::ENCODED_LEN,
12141 __tmp.remaining(),
12142 )
12143 }
12144 __tmp.put_f32_le(self.maximum_fuel);
12145 __tmp.put_f32_le(self.consumed_fuel);
12146 __tmp.put_f32_le(self.remaining_fuel);
12147 __tmp.put_f32_le(self.flow_rate);
12148 __tmp.put_f32_le(self.temperature);
12149 __tmp.put_u32_le(self.fuel_type as u32);
12150 __tmp.put_u8(self.id);
12151 __tmp.put_u8(self.percent_remaining);
12152 if matches!(version, MavlinkVersion::V2) {
12153 let len = __tmp.len();
12154 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
12155 } else {
12156 __tmp.len()
12157 }
12158 }
12159}
12160#[doc = "Telemetry of power generation system. Alternator or mechanical generator."]
12161#[doc = ""]
12162#[doc = "ID: 373"]
12163#[derive(Debug, Clone, PartialEq)]
12164#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
12165#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
12166pub struct GENERATOR_STATUS_DATA {
12167 #[doc = "Status flags."]
12168 pub status: MavGeneratorStatusFlag,
12169 #[doc = "Current into/out of battery. Positive for out. Negative for in. NaN: field not provided."]
12170 pub battery_current: f32,
12171 #[doc = "Current going to the UAV. If battery current not available this is the DC current from the generator. Positive for out. Negative for in. NaN: field not provided"]
12172 pub load_current: f32,
12173 #[doc = "The power being generated. NaN: field not provided"]
12174 pub power_generated: f32,
12175 #[doc = "Voltage of the bus seen at the generator, or battery bus if battery bus is controlled by generator and at a different voltage to main bus."]
12176 pub bus_voltage: f32,
12177 #[doc = "The target battery current. Positive for out. Negative for in. NaN: field not provided"]
12178 pub bat_current_setpoint: f32,
12179 #[doc = "Seconds this generator has run since it was rebooted. UINT32_MAX: field not provided."]
12180 pub runtime: u32,
12181 #[doc = "Seconds until this generator requires maintenance. A negative value indicates maintenance is past-due. INT32_MAX: field not provided."]
12182 pub time_until_maintenance: i32,
12183 #[doc = "Speed of electrical generator or alternator. UINT16_MAX: field not provided."]
12184 pub generator_speed: u16,
12185 #[doc = "The temperature of the rectifier or power converter. INT16_MAX: field not provided."]
12186 pub rectifier_temperature: i16,
12187 #[doc = "The temperature of the mechanical motor, fuel cell core or generator. INT16_MAX: field not provided."]
12188 pub generator_temperature: i16,
12189}
12190impl GENERATOR_STATUS_DATA {
12191 pub const ENCODED_LEN: usize = 42usize;
12192 pub const DEFAULT: Self = Self {
12193 status: MavGeneratorStatusFlag::DEFAULT,
12194 battery_current: 0.0_f32,
12195 load_current: 0.0_f32,
12196 power_generated: 0.0_f32,
12197 bus_voltage: 0.0_f32,
12198 bat_current_setpoint: 0.0_f32,
12199 runtime: 0_u32,
12200 time_until_maintenance: 0_i32,
12201 generator_speed: 0_u16,
12202 rectifier_temperature: 0_i16,
12203 generator_temperature: 0_i16,
12204 };
12205 #[cfg(feature = "arbitrary")]
12206 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
12207 use arbitrary::{Arbitrary, Unstructured};
12208 let mut buf = [0u8; 1024];
12209 rng.fill_bytes(&mut buf);
12210 let mut unstructured = Unstructured::new(&buf);
12211 Self::arbitrary(&mut unstructured).unwrap_or_default()
12212 }
12213}
12214impl Default for GENERATOR_STATUS_DATA {
12215 fn default() -> Self {
12216 Self::DEFAULT.clone()
12217 }
12218}
12219impl MessageData for GENERATOR_STATUS_DATA {
12220 type Message = MavMessage;
12221 const ID: u32 = 373u32;
12222 const NAME: &'static str = "GENERATOR_STATUS";
12223 const EXTRA_CRC: u8 = 117u8;
12224 const ENCODED_LEN: usize = 42usize;
12225 fn deser(
12226 _version: MavlinkVersion,
12227 __input: &[u8],
12228 ) -> Result<Self, ::mavlink_core::error::ParserError> {
12229 let avail_len = __input.len();
12230 let mut payload_buf = [0; Self::ENCODED_LEN];
12231 let mut buf = if avail_len < Self::ENCODED_LEN {
12232 payload_buf[0..avail_len].copy_from_slice(__input);
12233 Bytes::new(&payload_buf)
12234 } else {
12235 Bytes::new(__input)
12236 };
12237 let mut __struct = Self::default();
12238 let tmp = buf.get_u64_le();
12239 __struct.status = MavGeneratorStatusFlag::from_bits(
12240 tmp & MavGeneratorStatusFlag::all().bits(),
12241 )
12242 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
12243 flag_type: "MavGeneratorStatusFlag",
12244 value: tmp as u32,
12245 })?;
12246 __struct.battery_current = buf.get_f32_le();
12247 __struct.load_current = buf.get_f32_le();
12248 __struct.power_generated = buf.get_f32_le();
12249 __struct.bus_voltage = buf.get_f32_le();
12250 __struct.bat_current_setpoint = buf.get_f32_le();
12251 __struct.runtime = buf.get_u32_le();
12252 __struct.time_until_maintenance = buf.get_i32_le();
12253 __struct.generator_speed = buf.get_u16_le();
12254 __struct.rectifier_temperature = buf.get_i16_le();
12255 __struct.generator_temperature = buf.get_i16_le();
12256 Ok(__struct)
12257 }
12258 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
12259 let mut __tmp = BytesMut::new(bytes);
12260 #[allow(clippy::absurd_extreme_comparisons)]
12261 #[allow(unused_comparisons)]
12262 if __tmp.remaining() < Self::ENCODED_LEN {
12263 panic!(
12264 "buffer is too small (need {} bytes, but got {})",
12265 Self::ENCODED_LEN,
12266 __tmp.remaining(),
12267 )
12268 }
12269 __tmp.put_u64_le(self.status.bits());
12270 __tmp.put_f32_le(self.battery_current);
12271 __tmp.put_f32_le(self.load_current);
12272 __tmp.put_f32_le(self.power_generated);
12273 __tmp.put_f32_le(self.bus_voltage);
12274 __tmp.put_f32_le(self.bat_current_setpoint);
12275 __tmp.put_u32_le(self.runtime);
12276 __tmp.put_i32_le(self.time_until_maintenance);
12277 __tmp.put_u16_le(self.generator_speed);
12278 __tmp.put_i16_le(self.rectifier_temperature);
12279 __tmp.put_i16_le(self.generator_temperature);
12280 if matches!(version, MavlinkVersion::V2) {
12281 let len = __tmp.len();
12282 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
12283 } else {
12284 __tmp.len()
12285 }
12286 }
12287}
12288#[doc = "Message reporting the status of a gimbal device. \t This message should be broadcast by a gimbal device component at a low regular rate (e.g. 5 Hz). \t For the angles encoded in the quaternion and the angular velocities holds: \t If the flag GIMBAL_DEVICE_FLAGS_YAW_IN_VEHICLE_FRAME is set, then they are relative to the vehicle heading (vehicle frame). \t If the flag GIMBAL_DEVICE_FLAGS_YAW_IN_EARTH_FRAME is set, then they are relative to absolute North (earth frame). \t If neither of these flags are set, then (for backwards compatibility) it holds: \t If the flag GIMBAL_DEVICE_FLAGS_YAW_LOCK is set, then they are relative to absolute North (earth frame), \t else they are relative to the vehicle heading (vehicle frame). \t Other conditions of the flags are not allowed. \t The quaternion and angular velocities in the other frame can be calculated from delta_yaw and delta_yaw_velocity as \t q_earth = q_delta_yaw * q_vehicle and w_earth = w_delta_yaw_velocity + w_vehicle (if not NaN). \t If neither the GIMBAL_DEVICE_FLAGS_YAW_IN_VEHICLE_FRAME nor the GIMBAL_DEVICE_FLAGS_YAW_IN_EARTH_FRAME flag is set, \t then (for backwards compatibility) the data in the delta_yaw and delta_yaw_velocity fields are to be ignored. \t New implementations should always set either GIMBAL_DEVICE_FLAGS_YAW_IN_VEHICLE_FRAME or GIMBAL_DEVICE_FLAGS_YAW_IN_EARTH_FRAME, \t and always should set delta_yaw and delta_yaw_velocity either to the proper value or NaN."]
12289#[doc = ""]
12290#[doc = "ID: 285"]
12291#[derive(Debug, Clone, PartialEq)]
12292#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
12293#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
12294pub struct GIMBAL_DEVICE_ATTITUDE_STATUS_DATA {
12295 #[doc = "Timestamp (time since system boot)."]
12296 pub time_boot_ms: u32,
12297 #[doc = "Quaternion components, w, x, y, z (1 0 0 0 is the null-rotation). The frame is described in the message description."]
12298 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
12299 pub q: [f32; 4],
12300 #[doc = "X component of angular velocity (positive: rolling to the right). The frame is described in the message description. NaN if unknown."]
12301 pub angular_velocity_x: f32,
12302 #[doc = "Y component of angular velocity (positive: pitching up). The frame is described in the message description. NaN if unknown."]
12303 pub angular_velocity_y: f32,
12304 #[doc = "Z component of angular velocity (positive: yawing to the right). The frame is described in the message description. NaN if unknown."]
12305 pub angular_velocity_z: f32,
12306 #[doc = "Failure flags (0 for no failure)"]
12307 pub failure_flags: GimbalDeviceErrorFlags,
12308 #[doc = "Current gimbal flags set."]
12309 pub flags: GimbalDeviceFlags,
12310 #[doc = "System ID"]
12311 pub target_system: u8,
12312 #[doc = "Component ID"]
12313 pub target_component: u8,
12314 #[doc = "Yaw angle relating the quaternions in earth and body frames (see message description). NaN if unknown."]
12315 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
12316 pub delta_yaw: f32,
12317 #[doc = "Yaw angular velocity relating the angular velocities in earth and body frames (see message description). NaN if unknown."]
12318 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
12319 pub delta_yaw_velocity: f32,
12320 #[doc = "This field is to be used if the gimbal manager and the gimbal device are the same component and hence have the same component ID. This field is then set a number between 1-6. If the component ID is separate, this field is not required and must be set to 0."]
12321 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
12322 pub gimbal_device_id: u8,
12323}
12324impl GIMBAL_DEVICE_ATTITUDE_STATUS_DATA {
12325 pub const ENCODED_LEN: usize = 49usize;
12326 pub const DEFAULT: Self = Self {
12327 time_boot_ms: 0_u32,
12328 q: [0.0_f32; 4usize],
12329 angular_velocity_x: 0.0_f32,
12330 angular_velocity_y: 0.0_f32,
12331 angular_velocity_z: 0.0_f32,
12332 failure_flags: GimbalDeviceErrorFlags::DEFAULT,
12333 flags: GimbalDeviceFlags::DEFAULT,
12334 target_system: 0_u8,
12335 target_component: 0_u8,
12336 delta_yaw: 0.0_f32,
12337 delta_yaw_velocity: 0.0_f32,
12338 gimbal_device_id: 0_u8,
12339 };
12340 #[cfg(feature = "arbitrary")]
12341 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
12342 use arbitrary::{Arbitrary, Unstructured};
12343 let mut buf = [0u8; 1024];
12344 rng.fill_bytes(&mut buf);
12345 let mut unstructured = Unstructured::new(&buf);
12346 Self::arbitrary(&mut unstructured).unwrap_or_default()
12347 }
12348}
12349impl Default for GIMBAL_DEVICE_ATTITUDE_STATUS_DATA {
12350 fn default() -> Self {
12351 Self::DEFAULT.clone()
12352 }
12353}
12354impl MessageData for GIMBAL_DEVICE_ATTITUDE_STATUS_DATA {
12355 type Message = MavMessage;
12356 const ID: u32 = 285u32;
12357 const NAME: &'static str = "GIMBAL_DEVICE_ATTITUDE_STATUS";
12358 const EXTRA_CRC: u8 = 137u8;
12359 const ENCODED_LEN: usize = 49usize;
12360 fn deser(
12361 _version: MavlinkVersion,
12362 __input: &[u8],
12363 ) -> Result<Self, ::mavlink_core::error::ParserError> {
12364 let avail_len = __input.len();
12365 let mut payload_buf = [0; Self::ENCODED_LEN];
12366 let mut buf = if avail_len < Self::ENCODED_LEN {
12367 payload_buf[0..avail_len].copy_from_slice(__input);
12368 Bytes::new(&payload_buf)
12369 } else {
12370 Bytes::new(__input)
12371 };
12372 let mut __struct = Self::default();
12373 __struct.time_boot_ms = buf.get_u32_le();
12374 for v in &mut __struct.q {
12375 let val = buf.get_f32_le();
12376 *v = val;
12377 }
12378 __struct.angular_velocity_x = buf.get_f32_le();
12379 __struct.angular_velocity_y = buf.get_f32_le();
12380 __struct.angular_velocity_z = buf.get_f32_le();
12381 let tmp = buf.get_u32_le();
12382 __struct.failure_flags = GimbalDeviceErrorFlags::from_bits(
12383 tmp & GimbalDeviceErrorFlags::all().bits(),
12384 )
12385 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
12386 flag_type: "GimbalDeviceErrorFlags",
12387 value: tmp as u32,
12388 })?;
12389 let tmp = buf.get_u16_le();
12390 __struct.flags = GimbalDeviceFlags::from_bits(tmp & GimbalDeviceFlags::all().bits())
12391 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
12392 flag_type: "GimbalDeviceFlags",
12393 value: tmp as u32,
12394 })?;
12395 __struct.target_system = buf.get_u8();
12396 __struct.target_component = buf.get_u8();
12397 __struct.delta_yaw = buf.get_f32_le();
12398 __struct.delta_yaw_velocity = buf.get_f32_le();
12399 __struct.gimbal_device_id = buf.get_u8();
12400 Ok(__struct)
12401 }
12402 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
12403 let mut __tmp = BytesMut::new(bytes);
12404 #[allow(clippy::absurd_extreme_comparisons)]
12405 #[allow(unused_comparisons)]
12406 if __tmp.remaining() < Self::ENCODED_LEN {
12407 panic!(
12408 "buffer is too small (need {} bytes, but got {})",
12409 Self::ENCODED_LEN,
12410 __tmp.remaining(),
12411 )
12412 }
12413 __tmp.put_u32_le(self.time_boot_ms);
12414 for val in &self.q {
12415 __tmp.put_f32_le(*val);
12416 }
12417 __tmp.put_f32_le(self.angular_velocity_x);
12418 __tmp.put_f32_le(self.angular_velocity_y);
12419 __tmp.put_f32_le(self.angular_velocity_z);
12420 __tmp.put_u32_le(self.failure_flags.bits());
12421 __tmp.put_u16_le(self.flags.bits());
12422 __tmp.put_u8(self.target_system);
12423 __tmp.put_u8(self.target_component);
12424 if matches!(version, MavlinkVersion::V2) {
12425 __tmp.put_f32_le(self.delta_yaw);
12426 __tmp.put_f32_le(self.delta_yaw_velocity);
12427 __tmp.put_u8(self.gimbal_device_id);
12428 let len = __tmp.len();
12429 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
12430 } else {
12431 __tmp.len()
12432 }
12433 }
12434}
12435#[doc = "Information about a low level gimbal. This message should be requested by the gimbal manager or a ground station using MAV_CMD_REQUEST_MESSAGE. The maximum angles and rates are the limits by hardware. However, the limits by software used are likely different/smaller and dependent on mode/settings/etc.."]
12436#[doc = ""]
12437#[doc = "ID: 283"]
12438#[derive(Debug, Clone, PartialEq)]
12439#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
12440#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
12441pub struct GIMBAL_DEVICE_INFORMATION_DATA {
12442 #[doc = "UID of gimbal hardware (0 if unknown)."]
12443 pub uid: u64,
12444 #[doc = "Timestamp (time since system boot)."]
12445 pub time_boot_ms: u32,
12446 #[doc = "0xff)."]
12447 pub firmware_version: u32,
12448 #[doc = "0xff)."]
12449 pub hardware_version: u32,
12450 #[doc = "Minimum hardware roll angle (positive: rolling to the right, negative: rolling to the left). NAN if unknown."]
12451 pub roll_min: f32,
12452 #[doc = "Maximum hardware roll angle (positive: rolling to the right, negative: rolling to the left). NAN if unknown."]
12453 pub roll_max: f32,
12454 #[doc = "Minimum hardware pitch angle (positive: up, negative: down). NAN if unknown."]
12455 pub pitch_min: f32,
12456 #[doc = "Maximum hardware pitch angle (positive: up, negative: down). NAN if unknown."]
12457 pub pitch_max: f32,
12458 #[doc = "Minimum hardware yaw angle (positive: to the right, negative: to the left). NAN if unknown."]
12459 pub yaw_min: f32,
12460 #[doc = "Maximum hardware yaw angle (positive: to the right, negative: to the left). NAN if unknown."]
12461 pub yaw_max: f32,
12462 #[doc = "Bitmap of gimbal capability flags."]
12463 pub cap_flags: GimbalDeviceCapFlags,
12464 #[doc = "Bitmap for use for gimbal-specific capability flags."]
12465 pub custom_cap_flags: u16,
12466 #[doc = "Name of the gimbal vendor."]
12467 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
12468 pub vendor_name: [u8; 32],
12469 #[doc = "Name of the gimbal model."]
12470 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
12471 pub model_name: [u8; 32],
12472 #[doc = "Custom name of the gimbal given to it by the user."]
12473 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
12474 pub custom_name: [u8; 32],
12475 #[doc = "This field is to be used if the gimbal manager and the gimbal device are the same component and hence have the same component ID. This field is then set to a number between 1-6. If the component ID is separate, this field is not required and must be set to 0."]
12476 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
12477 pub gimbal_device_id: u8,
12478}
12479impl GIMBAL_DEVICE_INFORMATION_DATA {
12480 pub const ENCODED_LEN: usize = 145usize;
12481 pub const DEFAULT: Self = Self {
12482 uid: 0_u64,
12483 time_boot_ms: 0_u32,
12484 firmware_version: 0_u32,
12485 hardware_version: 0_u32,
12486 roll_min: 0.0_f32,
12487 roll_max: 0.0_f32,
12488 pitch_min: 0.0_f32,
12489 pitch_max: 0.0_f32,
12490 yaw_min: 0.0_f32,
12491 yaw_max: 0.0_f32,
12492 cap_flags: GimbalDeviceCapFlags::DEFAULT,
12493 custom_cap_flags: 0_u16,
12494 vendor_name: [0_u8; 32usize],
12495 model_name: [0_u8; 32usize],
12496 custom_name: [0_u8; 32usize],
12497 gimbal_device_id: 0_u8,
12498 };
12499 #[cfg(feature = "arbitrary")]
12500 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
12501 use arbitrary::{Arbitrary, Unstructured};
12502 let mut buf = [0u8; 1024];
12503 rng.fill_bytes(&mut buf);
12504 let mut unstructured = Unstructured::new(&buf);
12505 Self::arbitrary(&mut unstructured).unwrap_or_default()
12506 }
12507}
12508impl Default for GIMBAL_DEVICE_INFORMATION_DATA {
12509 fn default() -> Self {
12510 Self::DEFAULT.clone()
12511 }
12512}
12513impl MessageData for GIMBAL_DEVICE_INFORMATION_DATA {
12514 type Message = MavMessage;
12515 const ID: u32 = 283u32;
12516 const NAME: &'static str = "GIMBAL_DEVICE_INFORMATION";
12517 const EXTRA_CRC: u8 = 74u8;
12518 const ENCODED_LEN: usize = 145usize;
12519 fn deser(
12520 _version: MavlinkVersion,
12521 __input: &[u8],
12522 ) -> Result<Self, ::mavlink_core::error::ParserError> {
12523 let avail_len = __input.len();
12524 let mut payload_buf = [0; Self::ENCODED_LEN];
12525 let mut buf = if avail_len < Self::ENCODED_LEN {
12526 payload_buf[0..avail_len].copy_from_slice(__input);
12527 Bytes::new(&payload_buf)
12528 } else {
12529 Bytes::new(__input)
12530 };
12531 let mut __struct = Self::default();
12532 __struct.uid = buf.get_u64_le();
12533 __struct.time_boot_ms = buf.get_u32_le();
12534 __struct.firmware_version = buf.get_u32_le();
12535 __struct.hardware_version = buf.get_u32_le();
12536 __struct.roll_min = buf.get_f32_le();
12537 __struct.roll_max = buf.get_f32_le();
12538 __struct.pitch_min = buf.get_f32_le();
12539 __struct.pitch_max = buf.get_f32_le();
12540 __struct.yaw_min = buf.get_f32_le();
12541 __struct.yaw_max = buf.get_f32_le();
12542 let tmp = buf.get_u16_le();
12543 __struct.cap_flags = GimbalDeviceCapFlags::from_bits(
12544 tmp & GimbalDeviceCapFlags::all().bits(),
12545 )
12546 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
12547 flag_type: "GimbalDeviceCapFlags",
12548 value: tmp as u32,
12549 })?;
12550 __struct.custom_cap_flags = buf.get_u16_le();
12551 for v in &mut __struct.vendor_name {
12552 let val = buf.get_u8();
12553 *v = val;
12554 }
12555 for v in &mut __struct.model_name {
12556 let val = buf.get_u8();
12557 *v = val;
12558 }
12559 for v in &mut __struct.custom_name {
12560 let val = buf.get_u8();
12561 *v = val;
12562 }
12563 __struct.gimbal_device_id = buf.get_u8();
12564 Ok(__struct)
12565 }
12566 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
12567 let mut __tmp = BytesMut::new(bytes);
12568 #[allow(clippy::absurd_extreme_comparisons)]
12569 #[allow(unused_comparisons)]
12570 if __tmp.remaining() < Self::ENCODED_LEN {
12571 panic!(
12572 "buffer is too small (need {} bytes, but got {})",
12573 Self::ENCODED_LEN,
12574 __tmp.remaining(),
12575 )
12576 }
12577 __tmp.put_u64_le(self.uid);
12578 __tmp.put_u32_le(self.time_boot_ms);
12579 __tmp.put_u32_le(self.firmware_version);
12580 __tmp.put_u32_le(self.hardware_version);
12581 __tmp.put_f32_le(self.roll_min);
12582 __tmp.put_f32_le(self.roll_max);
12583 __tmp.put_f32_le(self.pitch_min);
12584 __tmp.put_f32_le(self.pitch_max);
12585 __tmp.put_f32_le(self.yaw_min);
12586 __tmp.put_f32_le(self.yaw_max);
12587 __tmp.put_u16_le(self.cap_flags.bits());
12588 __tmp.put_u16_le(self.custom_cap_flags);
12589 for val in &self.vendor_name {
12590 __tmp.put_u8(*val);
12591 }
12592 for val in &self.model_name {
12593 __tmp.put_u8(*val);
12594 }
12595 for val in &self.custom_name {
12596 __tmp.put_u8(*val);
12597 }
12598 if matches!(version, MavlinkVersion::V2) {
12599 __tmp.put_u8(self.gimbal_device_id);
12600 let len = __tmp.len();
12601 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
12602 } else {
12603 __tmp.len()
12604 }
12605 }
12606}
12607#[doc = "Low level message to control a gimbal device's attitude. \t This message is to be sent from the gimbal manager to the gimbal device component. \t The quaternion and angular velocities can be set to NaN according to use case. \t For the angles encoded in the quaternion and the angular velocities holds: \t If the flag GIMBAL_DEVICE_FLAGS_YAW_IN_VEHICLE_FRAME is set, then they are relative to the vehicle heading (vehicle frame). \t If the flag GIMBAL_DEVICE_FLAGS_YAW_IN_EARTH_FRAME is set, then they are relative to absolute North (earth frame). \t If neither of these flags are set, then (for backwards compatibility) it holds: \t If the flag GIMBAL_DEVICE_FLAGS_YAW_LOCK is set, then they are relative to absolute North (earth frame), \t else they are relative to the vehicle heading (vehicle frame). \t Setting both GIMBAL_DEVICE_FLAGS_YAW_IN_VEHICLE_FRAME and GIMBAL_DEVICE_FLAGS_YAW_IN_EARTH_FRAME is not allowed. \t These rules are to ensure backwards compatibility. \t New implementations should always set either GIMBAL_DEVICE_FLAGS_YAW_IN_VEHICLE_FRAME or GIMBAL_DEVICE_FLAGS_YAW_IN_EARTH_FRAME."]
12608#[doc = ""]
12609#[doc = "ID: 284"]
12610#[derive(Debug, Clone, PartialEq)]
12611#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
12612#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
12613pub struct GIMBAL_DEVICE_SET_ATTITUDE_DATA {
12614 #[doc = "Quaternion components, w, x, y, z (1 0 0 0 is the null-rotation). The frame is described in the message description. Set fields to NaN to be ignored."]
12615 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
12616 pub q: [f32; 4],
12617 #[doc = "X component of angular velocity (positive: rolling to the right). The frame is described in the message description. NaN to be ignored."]
12618 pub angular_velocity_x: f32,
12619 #[doc = "Y component of angular velocity (positive: pitching up). The frame is described in the message description. NaN to be ignored."]
12620 pub angular_velocity_y: f32,
12621 #[doc = "Z component of angular velocity (positive: yawing to the right). The frame is described in the message description. NaN to be ignored."]
12622 pub angular_velocity_z: f32,
12623 #[doc = "Low level gimbal flags."]
12624 pub flags: GimbalDeviceFlags,
12625 #[doc = "System ID"]
12626 pub target_system: u8,
12627 #[doc = "Component ID"]
12628 pub target_component: u8,
12629}
12630impl GIMBAL_DEVICE_SET_ATTITUDE_DATA {
12631 pub const ENCODED_LEN: usize = 32usize;
12632 pub const DEFAULT: Self = Self {
12633 q: [0.0_f32; 4usize],
12634 angular_velocity_x: 0.0_f32,
12635 angular_velocity_y: 0.0_f32,
12636 angular_velocity_z: 0.0_f32,
12637 flags: GimbalDeviceFlags::DEFAULT,
12638 target_system: 0_u8,
12639 target_component: 0_u8,
12640 };
12641 #[cfg(feature = "arbitrary")]
12642 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
12643 use arbitrary::{Arbitrary, Unstructured};
12644 let mut buf = [0u8; 1024];
12645 rng.fill_bytes(&mut buf);
12646 let mut unstructured = Unstructured::new(&buf);
12647 Self::arbitrary(&mut unstructured).unwrap_or_default()
12648 }
12649}
12650impl Default for GIMBAL_DEVICE_SET_ATTITUDE_DATA {
12651 fn default() -> Self {
12652 Self::DEFAULT.clone()
12653 }
12654}
12655impl MessageData for GIMBAL_DEVICE_SET_ATTITUDE_DATA {
12656 type Message = MavMessage;
12657 const ID: u32 = 284u32;
12658 const NAME: &'static str = "GIMBAL_DEVICE_SET_ATTITUDE";
12659 const EXTRA_CRC: u8 = 99u8;
12660 const ENCODED_LEN: usize = 32usize;
12661 fn deser(
12662 _version: MavlinkVersion,
12663 __input: &[u8],
12664 ) -> Result<Self, ::mavlink_core::error::ParserError> {
12665 let avail_len = __input.len();
12666 let mut payload_buf = [0; Self::ENCODED_LEN];
12667 let mut buf = if avail_len < Self::ENCODED_LEN {
12668 payload_buf[0..avail_len].copy_from_slice(__input);
12669 Bytes::new(&payload_buf)
12670 } else {
12671 Bytes::new(__input)
12672 };
12673 let mut __struct = Self::default();
12674 for v in &mut __struct.q {
12675 let val = buf.get_f32_le();
12676 *v = val;
12677 }
12678 __struct.angular_velocity_x = buf.get_f32_le();
12679 __struct.angular_velocity_y = buf.get_f32_le();
12680 __struct.angular_velocity_z = buf.get_f32_le();
12681 let tmp = buf.get_u16_le();
12682 __struct.flags = GimbalDeviceFlags::from_bits(tmp & GimbalDeviceFlags::all().bits())
12683 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
12684 flag_type: "GimbalDeviceFlags",
12685 value: tmp as u32,
12686 })?;
12687 __struct.target_system = buf.get_u8();
12688 __struct.target_component = buf.get_u8();
12689 Ok(__struct)
12690 }
12691 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
12692 let mut __tmp = BytesMut::new(bytes);
12693 #[allow(clippy::absurd_extreme_comparisons)]
12694 #[allow(unused_comparisons)]
12695 if __tmp.remaining() < Self::ENCODED_LEN {
12696 panic!(
12697 "buffer is too small (need {} bytes, but got {})",
12698 Self::ENCODED_LEN,
12699 __tmp.remaining(),
12700 )
12701 }
12702 for val in &self.q {
12703 __tmp.put_f32_le(*val);
12704 }
12705 __tmp.put_f32_le(self.angular_velocity_x);
12706 __tmp.put_f32_le(self.angular_velocity_y);
12707 __tmp.put_f32_le(self.angular_velocity_z);
12708 __tmp.put_u16_le(self.flags.bits());
12709 __tmp.put_u8(self.target_system);
12710 __tmp.put_u8(self.target_component);
12711 if matches!(version, MavlinkVersion::V2) {
12712 let len = __tmp.len();
12713 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
12714 } else {
12715 __tmp.len()
12716 }
12717 }
12718}
12719#[doc = "Information about a high level gimbal manager. This message should be requested by a ground station using MAV_CMD_REQUEST_MESSAGE."]
12720#[doc = ""]
12721#[doc = "ID: 280"]
12722#[derive(Debug, Clone, PartialEq)]
12723#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
12724#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
12725pub struct GIMBAL_MANAGER_INFORMATION_DATA {
12726 #[doc = "Timestamp (time since system boot)."]
12727 pub time_boot_ms: u32,
12728 #[doc = "Bitmap of gimbal capability flags."]
12729 pub cap_flags: GimbalManagerCapFlags,
12730 #[doc = "Minimum hardware roll angle (positive: rolling to the right, negative: rolling to the left)"]
12731 pub roll_min: f32,
12732 #[doc = "Maximum hardware roll angle (positive: rolling to the right, negative: rolling to the left)"]
12733 pub roll_max: f32,
12734 #[doc = "Minimum pitch angle (positive: up, negative: down)"]
12735 pub pitch_min: f32,
12736 #[doc = "Maximum pitch angle (positive: up, negative: down)"]
12737 pub pitch_max: f32,
12738 #[doc = "Minimum yaw angle (positive: to the right, negative: to the left)"]
12739 pub yaw_min: f32,
12740 #[doc = "Maximum yaw angle (positive: to the right, negative: to the left)"]
12741 pub yaw_max: f32,
12742 #[doc = "Gimbal device ID that this gimbal manager is responsible for. Component ID of gimbal device (or 1-6 for non-MAVLink gimbal)."]
12743 pub gimbal_device_id: u8,
12744}
12745impl GIMBAL_MANAGER_INFORMATION_DATA {
12746 pub const ENCODED_LEN: usize = 33usize;
12747 pub const DEFAULT: Self = Self {
12748 time_boot_ms: 0_u32,
12749 cap_flags: GimbalManagerCapFlags::DEFAULT,
12750 roll_min: 0.0_f32,
12751 roll_max: 0.0_f32,
12752 pitch_min: 0.0_f32,
12753 pitch_max: 0.0_f32,
12754 yaw_min: 0.0_f32,
12755 yaw_max: 0.0_f32,
12756 gimbal_device_id: 0_u8,
12757 };
12758 #[cfg(feature = "arbitrary")]
12759 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
12760 use arbitrary::{Arbitrary, Unstructured};
12761 let mut buf = [0u8; 1024];
12762 rng.fill_bytes(&mut buf);
12763 let mut unstructured = Unstructured::new(&buf);
12764 Self::arbitrary(&mut unstructured).unwrap_or_default()
12765 }
12766}
12767impl Default for GIMBAL_MANAGER_INFORMATION_DATA {
12768 fn default() -> Self {
12769 Self::DEFAULT.clone()
12770 }
12771}
12772impl MessageData for GIMBAL_MANAGER_INFORMATION_DATA {
12773 type Message = MavMessage;
12774 const ID: u32 = 280u32;
12775 const NAME: &'static str = "GIMBAL_MANAGER_INFORMATION";
12776 const EXTRA_CRC: u8 = 70u8;
12777 const ENCODED_LEN: usize = 33usize;
12778 fn deser(
12779 _version: MavlinkVersion,
12780 __input: &[u8],
12781 ) -> Result<Self, ::mavlink_core::error::ParserError> {
12782 let avail_len = __input.len();
12783 let mut payload_buf = [0; Self::ENCODED_LEN];
12784 let mut buf = if avail_len < Self::ENCODED_LEN {
12785 payload_buf[0..avail_len].copy_from_slice(__input);
12786 Bytes::new(&payload_buf)
12787 } else {
12788 Bytes::new(__input)
12789 };
12790 let mut __struct = Self::default();
12791 __struct.time_boot_ms = buf.get_u32_le();
12792 let tmp = buf.get_u32_le();
12793 __struct.cap_flags = GimbalManagerCapFlags::from_bits(
12794 tmp & GimbalManagerCapFlags::all().bits(),
12795 )
12796 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
12797 flag_type: "GimbalManagerCapFlags",
12798 value: tmp as u32,
12799 })?;
12800 __struct.roll_min = buf.get_f32_le();
12801 __struct.roll_max = buf.get_f32_le();
12802 __struct.pitch_min = buf.get_f32_le();
12803 __struct.pitch_max = buf.get_f32_le();
12804 __struct.yaw_min = buf.get_f32_le();
12805 __struct.yaw_max = buf.get_f32_le();
12806 __struct.gimbal_device_id = buf.get_u8();
12807 Ok(__struct)
12808 }
12809 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
12810 let mut __tmp = BytesMut::new(bytes);
12811 #[allow(clippy::absurd_extreme_comparisons)]
12812 #[allow(unused_comparisons)]
12813 if __tmp.remaining() < Self::ENCODED_LEN {
12814 panic!(
12815 "buffer is too small (need {} bytes, but got {})",
12816 Self::ENCODED_LEN,
12817 __tmp.remaining(),
12818 )
12819 }
12820 __tmp.put_u32_le(self.time_boot_ms);
12821 __tmp.put_u32_le(self.cap_flags.bits());
12822 __tmp.put_f32_le(self.roll_min);
12823 __tmp.put_f32_le(self.roll_max);
12824 __tmp.put_f32_le(self.pitch_min);
12825 __tmp.put_f32_le(self.pitch_max);
12826 __tmp.put_f32_le(self.yaw_min);
12827 __tmp.put_f32_le(self.yaw_max);
12828 __tmp.put_u8(self.gimbal_device_id);
12829 if matches!(version, MavlinkVersion::V2) {
12830 let len = __tmp.len();
12831 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
12832 } else {
12833 __tmp.len()
12834 }
12835 }
12836}
12837#[doc = "High level message to control a gimbal's attitude. This message is to be sent to the gimbal manager (e.g. from a ground station). Angles and rates can be set to NaN according to use case."]
12838#[doc = ""]
12839#[doc = "ID: 282"]
12840#[derive(Debug, Clone, PartialEq)]
12841#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
12842#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
12843pub struct GIMBAL_MANAGER_SET_ATTITUDE_DATA {
12844 #[doc = "High level gimbal manager flags to use."]
12845 pub flags: GimbalManagerFlags,
12846 #[doc = "Quaternion components, w, x, y, z (1 0 0 0 is the null-rotation, the frame is depends on whether the flag GIMBAL_MANAGER_FLAGS_YAW_LOCK is set)"]
12847 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
12848 pub q: [f32; 4],
12849 #[doc = "X component of angular velocity, positive is rolling to the right, NaN to be ignored."]
12850 pub angular_velocity_x: f32,
12851 #[doc = "Y component of angular velocity, positive is pitching up, NaN to be ignored."]
12852 pub angular_velocity_y: f32,
12853 #[doc = "Z component of angular velocity, positive is yawing to the right, NaN to be ignored."]
12854 pub angular_velocity_z: f32,
12855 #[doc = "System ID"]
12856 pub target_system: u8,
12857 #[doc = "Component ID"]
12858 pub target_component: u8,
12859 #[doc = "Component ID of gimbal device to address (or 1-6 for non-MAVLink gimbal), 0 for all gimbal device components. Send command multiple times for more than one gimbal (but not all gimbals)."]
12860 pub gimbal_device_id: u8,
12861}
12862impl GIMBAL_MANAGER_SET_ATTITUDE_DATA {
12863 pub const ENCODED_LEN: usize = 35usize;
12864 pub const DEFAULT: Self = Self {
12865 flags: GimbalManagerFlags::DEFAULT,
12866 q: [0.0_f32; 4usize],
12867 angular_velocity_x: 0.0_f32,
12868 angular_velocity_y: 0.0_f32,
12869 angular_velocity_z: 0.0_f32,
12870 target_system: 0_u8,
12871 target_component: 0_u8,
12872 gimbal_device_id: 0_u8,
12873 };
12874 #[cfg(feature = "arbitrary")]
12875 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
12876 use arbitrary::{Arbitrary, Unstructured};
12877 let mut buf = [0u8; 1024];
12878 rng.fill_bytes(&mut buf);
12879 let mut unstructured = Unstructured::new(&buf);
12880 Self::arbitrary(&mut unstructured).unwrap_or_default()
12881 }
12882}
12883impl Default for GIMBAL_MANAGER_SET_ATTITUDE_DATA {
12884 fn default() -> Self {
12885 Self::DEFAULT.clone()
12886 }
12887}
12888impl MessageData for GIMBAL_MANAGER_SET_ATTITUDE_DATA {
12889 type Message = MavMessage;
12890 const ID: u32 = 282u32;
12891 const NAME: &'static str = "GIMBAL_MANAGER_SET_ATTITUDE";
12892 const EXTRA_CRC: u8 = 123u8;
12893 const ENCODED_LEN: usize = 35usize;
12894 fn deser(
12895 _version: MavlinkVersion,
12896 __input: &[u8],
12897 ) -> Result<Self, ::mavlink_core::error::ParserError> {
12898 let avail_len = __input.len();
12899 let mut payload_buf = [0; Self::ENCODED_LEN];
12900 let mut buf = if avail_len < Self::ENCODED_LEN {
12901 payload_buf[0..avail_len].copy_from_slice(__input);
12902 Bytes::new(&payload_buf)
12903 } else {
12904 Bytes::new(__input)
12905 };
12906 let mut __struct = Self::default();
12907 let tmp = buf.get_u32_le();
12908 __struct.flags = GimbalManagerFlags::from_bits(tmp & GimbalManagerFlags::all().bits())
12909 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
12910 flag_type: "GimbalManagerFlags",
12911 value: tmp as u32,
12912 })?;
12913 for v in &mut __struct.q {
12914 let val = buf.get_f32_le();
12915 *v = val;
12916 }
12917 __struct.angular_velocity_x = buf.get_f32_le();
12918 __struct.angular_velocity_y = buf.get_f32_le();
12919 __struct.angular_velocity_z = buf.get_f32_le();
12920 __struct.target_system = buf.get_u8();
12921 __struct.target_component = buf.get_u8();
12922 __struct.gimbal_device_id = buf.get_u8();
12923 Ok(__struct)
12924 }
12925 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
12926 let mut __tmp = BytesMut::new(bytes);
12927 #[allow(clippy::absurd_extreme_comparisons)]
12928 #[allow(unused_comparisons)]
12929 if __tmp.remaining() < Self::ENCODED_LEN {
12930 panic!(
12931 "buffer is too small (need {} bytes, but got {})",
12932 Self::ENCODED_LEN,
12933 __tmp.remaining(),
12934 )
12935 }
12936 __tmp.put_u32_le(self.flags.bits());
12937 for val in &self.q {
12938 __tmp.put_f32_le(*val);
12939 }
12940 __tmp.put_f32_le(self.angular_velocity_x);
12941 __tmp.put_f32_le(self.angular_velocity_y);
12942 __tmp.put_f32_le(self.angular_velocity_z);
12943 __tmp.put_u8(self.target_system);
12944 __tmp.put_u8(self.target_component);
12945 __tmp.put_u8(self.gimbal_device_id);
12946 if matches!(version, MavlinkVersion::V2) {
12947 let len = __tmp.len();
12948 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
12949 } else {
12950 __tmp.len()
12951 }
12952 }
12953}
12954#[doc = "High level message to control a gimbal manually. The angles or angular rates are unitless; the actual rates will depend on internal gimbal manager settings/configuration (e.g. set by parameters). This message is to be sent to the gimbal manager (e.g. from a ground station). Angles and rates can be set to NaN according to use case."]
12955#[doc = ""]
12956#[doc = "ID: 288"]
12957#[derive(Debug, Clone, PartialEq)]
12958#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
12959#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
12960pub struct GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA {
12961 #[doc = "High level gimbal manager flags."]
12962 pub flags: GimbalManagerFlags,
12963 #[doc = "Pitch angle unitless (-1..1, positive: up, negative: down, NaN to be ignored)."]
12964 pub pitch: f32,
12965 #[doc = "Yaw angle unitless (-1..1, positive: to the right, negative: to the left, NaN to be ignored)."]
12966 pub yaw: f32,
12967 #[doc = "Pitch angular rate unitless (-1..1, positive: up, negative: down, NaN to be ignored)."]
12968 pub pitch_rate: f32,
12969 #[doc = "Yaw angular rate unitless (-1..1, positive: to the right, negative: to the left, NaN to be ignored)."]
12970 pub yaw_rate: f32,
12971 #[doc = "System ID"]
12972 pub target_system: u8,
12973 #[doc = "Component ID"]
12974 pub target_component: u8,
12975 #[doc = "Component ID of gimbal device to address (or 1-6 for non-MAVLink gimbal), 0 for all gimbal device components. Send command multiple times for more than one gimbal (but not all gimbals)."]
12976 pub gimbal_device_id: u8,
12977}
12978impl GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA {
12979 pub const ENCODED_LEN: usize = 23usize;
12980 pub const DEFAULT: Self = Self {
12981 flags: GimbalManagerFlags::DEFAULT,
12982 pitch: 0.0_f32,
12983 yaw: 0.0_f32,
12984 pitch_rate: 0.0_f32,
12985 yaw_rate: 0.0_f32,
12986 target_system: 0_u8,
12987 target_component: 0_u8,
12988 gimbal_device_id: 0_u8,
12989 };
12990 #[cfg(feature = "arbitrary")]
12991 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
12992 use arbitrary::{Arbitrary, Unstructured};
12993 let mut buf = [0u8; 1024];
12994 rng.fill_bytes(&mut buf);
12995 let mut unstructured = Unstructured::new(&buf);
12996 Self::arbitrary(&mut unstructured).unwrap_or_default()
12997 }
12998}
12999impl Default for GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA {
13000 fn default() -> Self {
13001 Self::DEFAULT.clone()
13002 }
13003}
13004impl MessageData for GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA {
13005 type Message = MavMessage;
13006 const ID: u32 = 288u32;
13007 const NAME: &'static str = "GIMBAL_MANAGER_SET_MANUAL_CONTROL";
13008 const EXTRA_CRC: u8 = 20u8;
13009 const ENCODED_LEN: usize = 23usize;
13010 fn deser(
13011 _version: MavlinkVersion,
13012 __input: &[u8],
13013 ) -> Result<Self, ::mavlink_core::error::ParserError> {
13014 let avail_len = __input.len();
13015 let mut payload_buf = [0; Self::ENCODED_LEN];
13016 let mut buf = if avail_len < Self::ENCODED_LEN {
13017 payload_buf[0..avail_len].copy_from_slice(__input);
13018 Bytes::new(&payload_buf)
13019 } else {
13020 Bytes::new(__input)
13021 };
13022 let mut __struct = Self::default();
13023 let tmp = buf.get_u32_le();
13024 __struct.flags = GimbalManagerFlags::from_bits(tmp & GimbalManagerFlags::all().bits())
13025 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
13026 flag_type: "GimbalManagerFlags",
13027 value: tmp as u32,
13028 })?;
13029 __struct.pitch = buf.get_f32_le();
13030 __struct.yaw = buf.get_f32_le();
13031 __struct.pitch_rate = buf.get_f32_le();
13032 __struct.yaw_rate = buf.get_f32_le();
13033 __struct.target_system = buf.get_u8();
13034 __struct.target_component = buf.get_u8();
13035 __struct.gimbal_device_id = buf.get_u8();
13036 Ok(__struct)
13037 }
13038 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
13039 let mut __tmp = BytesMut::new(bytes);
13040 #[allow(clippy::absurd_extreme_comparisons)]
13041 #[allow(unused_comparisons)]
13042 if __tmp.remaining() < Self::ENCODED_LEN {
13043 panic!(
13044 "buffer is too small (need {} bytes, but got {})",
13045 Self::ENCODED_LEN,
13046 __tmp.remaining(),
13047 )
13048 }
13049 __tmp.put_u32_le(self.flags.bits());
13050 __tmp.put_f32_le(self.pitch);
13051 __tmp.put_f32_le(self.yaw);
13052 __tmp.put_f32_le(self.pitch_rate);
13053 __tmp.put_f32_le(self.yaw_rate);
13054 __tmp.put_u8(self.target_system);
13055 __tmp.put_u8(self.target_component);
13056 __tmp.put_u8(self.gimbal_device_id);
13057 if matches!(version, MavlinkVersion::V2) {
13058 let len = __tmp.len();
13059 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
13060 } else {
13061 __tmp.len()
13062 }
13063 }
13064}
13065#[doc = "Set gimbal manager pitch and yaw angles (high rate message). This message is to be sent to the gimbal manager (e.g. from a ground station) and will be ignored by gimbal devices. Angles and rates can be set to NaN according to use case. Use MAV_CMD_DO_GIMBAL_MANAGER_PITCHYAW for low-rate adjustments that require confirmation."]
13066#[doc = ""]
13067#[doc = "ID: 287"]
13068#[derive(Debug, Clone, PartialEq)]
13069#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
13070#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
13071pub struct GIMBAL_MANAGER_SET_PITCHYAW_DATA {
13072 #[doc = "High level gimbal manager flags to use."]
13073 pub flags: GimbalManagerFlags,
13074 #[doc = "Pitch angle (positive: up, negative: down, NaN to be ignored)."]
13075 pub pitch: f32,
13076 #[doc = "Yaw angle (positive: to the right, negative: to the left, NaN to be ignored)."]
13077 pub yaw: f32,
13078 #[doc = "Pitch angular rate (positive: up, negative: down, NaN to be ignored)."]
13079 pub pitch_rate: f32,
13080 #[doc = "Yaw angular rate (positive: to the right, negative: to the left, NaN to be ignored)."]
13081 pub yaw_rate: f32,
13082 #[doc = "System ID"]
13083 pub target_system: u8,
13084 #[doc = "Component ID"]
13085 pub target_component: u8,
13086 #[doc = "Component ID of gimbal device to address (or 1-6 for non-MAVLink gimbal), 0 for all gimbal device components. Send command multiple times for more than one gimbal (but not all gimbals)."]
13087 pub gimbal_device_id: u8,
13088}
13089impl GIMBAL_MANAGER_SET_PITCHYAW_DATA {
13090 pub const ENCODED_LEN: usize = 23usize;
13091 pub const DEFAULT: Self = Self {
13092 flags: GimbalManagerFlags::DEFAULT,
13093 pitch: 0.0_f32,
13094 yaw: 0.0_f32,
13095 pitch_rate: 0.0_f32,
13096 yaw_rate: 0.0_f32,
13097 target_system: 0_u8,
13098 target_component: 0_u8,
13099 gimbal_device_id: 0_u8,
13100 };
13101 #[cfg(feature = "arbitrary")]
13102 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
13103 use arbitrary::{Arbitrary, Unstructured};
13104 let mut buf = [0u8; 1024];
13105 rng.fill_bytes(&mut buf);
13106 let mut unstructured = Unstructured::new(&buf);
13107 Self::arbitrary(&mut unstructured).unwrap_or_default()
13108 }
13109}
13110impl Default for GIMBAL_MANAGER_SET_PITCHYAW_DATA {
13111 fn default() -> Self {
13112 Self::DEFAULT.clone()
13113 }
13114}
13115impl MessageData for GIMBAL_MANAGER_SET_PITCHYAW_DATA {
13116 type Message = MavMessage;
13117 const ID: u32 = 287u32;
13118 const NAME: &'static str = "GIMBAL_MANAGER_SET_PITCHYAW";
13119 const EXTRA_CRC: u8 = 1u8;
13120 const ENCODED_LEN: usize = 23usize;
13121 fn deser(
13122 _version: MavlinkVersion,
13123 __input: &[u8],
13124 ) -> Result<Self, ::mavlink_core::error::ParserError> {
13125 let avail_len = __input.len();
13126 let mut payload_buf = [0; Self::ENCODED_LEN];
13127 let mut buf = if avail_len < Self::ENCODED_LEN {
13128 payload_buf[0..avail_len].copy_from_slice(__input);
13129 Bytes::new(&payload_buf)
13130 } else {
13131 Bytes::new(__input)
13132 };
13133 let mut __struct = Self::default();
13134 let tmp = buf.get_u32_le();
13135 __struct.flags = GimbalManagerFlags::from_bits(tmp & GimbalManagerFlags::all().bits())
13136 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
13137 flag_type: "GimbalManagerFlags",
13138 value: tmp as u32,
13139 })?;
13140 __struct.pitch = buf.get_f32_le();
13141 __struct.yaw = buf.get_f32_le();
13142 __struct.pitch_rate = buf.get_f32_le();
13143 __struct.yaw_rate = buf.get_f32_le();
13144 __struct.target_system = buf.get_u8();
13145 __struct.target_component = buf.get_u8();
13146 __struct.gimbal_device_id = buf.get_u8();
13147 Ok(__struct)
13148 }
13149 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
13150 let mut __tmp = BytesMut::new(bytes);
13151 #[allow(clippy::absurd_extreme_comparisons)]
13152 #[allow(unused_comparisons)]
13153 if __tmp.remaining() < Self::ENCODED_LEN {
13154 panic!(
13155 "buffer is too small (need {} bytes, but got {})",
13156 Self::ENCODED_LEN,
13157 __tmp.remaining(),
13158 )
13159 }
13160 __tmp.put_u32_le(self.flags.bits());
13161 __tmp.put_f32_le(self.pitch);
13162 __tmp.put_f32_le(self.yaw);
13163 __tmp.put_f32_le(self.pitch_rate);
13164 __tmp.put_f32_le(self.yaw_rate);
13165 __tmp.put_u8(self.target_system);
13166 __tmp.put_u8(self.target_component);
13167 __tmp.put_u8(self.gimbal_device_id);
13168 if matches!(version, MavlinkVersion::V2) {
13169 let len = __tmp.len();
13170 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
13171 } else {
13172 __tmp.len()
13173 }
13174 }
13175}
13176#[doc = "Current status about a high level gimbal manager. This message should be broadcast at a low regular rate (e.g. 5Hz)."]
13177#[doc = ""]
13178#[doc = "ID: 281"]
13179#[derive(Debug, Clone, PartialEq)]
13180#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
13181#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
13182pub struct GIMBAL_MANAGER_STATUS_DATA {
13183 #[doc = "Timestamp (time since system boot)."]
13184 pub time_boot_ms: u32,
13185 #[doc = "High level gimbal manager flags currently applied."]
13186 pub flags: GimbalManagerFlags,
13187 #[doc = "Gimbal device ID that this gimbal manager is responsible for. Component ID of gimbal device (or 1-6 for non-MAVLink gimbal)."]
13188 pub gimbal_device_id: u8,
13189 #[doc = "System ID of MAVLink component with primary control, 0 for none."]
13190 pub primary_control_sysid: u8,
13191 #[doc = "Component ID of MAVLink component with primary control, 0 for none."]
13192 pub primary_control_compid: u8,
13193 #[doc = "System ID of MAVLink component with secondary control, 0 for none."]
13194 pub secondary_control_sysid: u8,
13195 #[doc = "Component ID of MAVLink component with secondary control, 0 for none."]
13196 pub secondary_control_compid: u8,
13197}
13198impl GIMBAL_MANAGER_STATUS_DATA {
13199 pub const ENCODED_LEN: usize = 13usize;
13200 pub const DEFAULT: Self = Self {
13201 time_boot_ms: 0_u32,
13202 flags: GimbalManagerFlags::DEFAULT,
13203 gimbal_device_id: 0_u8,
13204 primary_control_sysid: 0_u8,
13205 primary_control_compid: 0_u8,
13206 secondary_control_sysid: 0_u8,
13207 secondary_control_compid: 0_u8,
13208 };
13209 #[cfg(feature = "arbitrary")]
13210 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
13211 use arbitrary::{Arbitrary, Unstructured};
13212 let mut buf = [0u8; 1024];
13213 rng.fill_bytes(&mut buf);
13214 let mut unstructured = Unstructured::new(&buf);
13215 Self::arbitrary(&mut unstructured).unwrap_or_default()
13216 }
13217}
13218impl Default for GIMBAL_MANAGER_STATUS_DATA {
13219 fn default() -> Self {
13220 Self::DEFAULT.clone()
13221 }
13222}
13223impl MessageData for GIMBAL_MANAGER_STATUS_DATA {
13224 type Message = MavMessage;
13225 const ID: u32 = 281u32;
13226 const NAME: &'static str = "GIMBAL_MANAGER_STATUS";
13227 const EXTRA_CRC: u8 = 48u8;
13228 const ENCODED_LEN: usize = 13usize;
13229 fn deser(
13230 _version: MavlinkVersion,
13231 __input: &[u8],
13232 ) -> Result<Self, ::mavlink_core::error::ParserError> {
13233 let avail_len = __input.len();
13234 let mut payload_buf = [0; Self::ENCODED_LEN];
13235 let mut buf = if avail_len < Self::ENCODED_LEN {
13236 payload_buf[0..avail_len].copy_from_slice(__input);
13237 Bytes::new(&payload_buf)
13238 } else {
13239 Bytes::new(__input)
13240 };
13241 let mut __struct = Self::default();
13242 __struct.time_boot_ms = buf.get_u32_le();
13243 let tmp = buf.get_u32_le();
13244 __struct.flags = GimbalManagerFlags::from_bits(tmp & GimbalManagerFlags::all().bits())
13245 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
13246 flag_type: "GimbalManagerFlags",
13247 value: tmp as u32,
13248 })?;
13249 __struct.gimbal_device_id = buf.get_u8();
13250 __struct.primary_control_sysid = buf.get_u8();
13251 __struct.primary_control_compid = buf.get_u8();
13252 __struct.secondary_control_sysid = buf.get_u8();
13253 __struct.secondary_control_compid = buf.get_u8();
13254 Ok(__struct)
13255 }
13256 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
13257 let mut __tmp = BytesMut::new(bytes);
13258 #[allow(clippy::absurd_extreme_comparisons)]
13259 #[allow(unused_comparisons)]
13260 if __tmp.remaining() < Self::ENCODED_LEN {
13261 panic!(
13262 "buffer is too small (need {} bytes, but got {})",
13263 Self::ENCODED_LEN,
13264 __tmp.remaining(),
13265 )
13266 }
13267 __tmp.put_u32_le(self.time_boot_ms);
13268 __tmp.put_u32_le(self.flags.bits());
13269 __tmp.put_u8(self.gimbal_device_id);
13270 __tmp.put_u8(self.primary_control_sysid);
13271 __tmp.put_u8(self.primary_control_compid);
13272 __tmp.put_u8(self.secondary_control_sysid);
13273 __tmp.put_u8(self.secondary_control_compid);
13274 if matches!(version, MavlinkVersion::V2) {
13275 let len = __tmp.len();
13276 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
13277 } else {
13278 __tmp.len()
13279 }
13280 }
13281}
13282#[doc = "The filtered global position (e.g. fused GPS and accelerometers). The position is in GPS-frame (right-handed, Z-up). It is designed as scaled integer message since the resolution of float is not sufficient."]
13283#[doc = ""]
13284#[doc = "ID: 33"]
13285#[derive(Debug, Clone, PartialEq)]
13286#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
13287#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
13288pub struct GLOBAL_POSITION_INT_DATA {
13289 #[doc = "Timestamp (time since system boot)."]
13290 pub time_boot_ms: u32,
13291 #[doc = "Latitude, expressed"]
13292 pub lat: i32,
13293 #[doc = "Longitude, expressed"]
13294 pub lon: i32,
13295 #[doc = "Altitude (MSL). Note that virtually all GPS modules provide both WGS84 and MSL."]
13296 pub alt: i32,
13297 #[doc = "Altitude above home"]
13298 pub relative_alt: i32,
13299 #[doc = "Ground X Speed (Latitude, positive north)"]
13300 pub vx: i16,
13301 #[doc = "Ground Y Speed (Longitude, positive east)"]
13302 pub vy: i16,
13303 #[doc = "Ground Z Speed (Altitude, positive down)"]
13304 pub vz: i16,
13305 #[doc = "Vehicle heading (yaw angle), 0.0..359.99 degrees. If unknown, set to: UINT16_MAX"]
13306 pub hdg: u16,
13307}
13308impl GLOBAL_POSITION_INT_DATA {
13309 pub const ENCODED_LEN: usize = 28usize;
13310 pub const DEFAULT: Self = Self {
13311 time_boot_ms: 0_u32,
13312 lat: 0_i32,
13313 lon: 0_i32,
13314 alt: 0_i32,
13315 relative_alt: 0_i32,
13316 vx: 0_i16,
13317 vy: 0_i16,
13318 vz: 0_i16,
13319 hdg: 0_u16,
13320 };
13321 #[cfg(feature = "arbitrary")]
13322 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
13323 use arbitrary::{Arbitrary, Unstructured};
13324 let mut buf = [0u8; 1024];
13325 rng.fill_bytes(&mut buf);
13326 let mut unstructured = Unstructured::new(&buf);
13327 Self::arbitrary(&mut unstructured).unwrap_or_default()
13328 }
13329}
13330impl Default for GLOBAL_POSITION_INT_DATA {
13331 fn default() -> Self {
13332 Self::DEFAULT.clone()
13333 }
13334}
13335impl MessageData for GLOBAL_POSITION_INT_DATA {
13336 type Message = MavMessage;
13337 const ID: u32 = 33u32;
13338 const NAME: &'static str = "GLOBAL_POSITION_INT";
13339 const EXTRA_CRC: u8 = 104u8;
13340 const ENCODED_LEN: usize = 28usize;
13341 fn deser(
13342 _version: MavlinkVersion,
13343 __input: &[u8],
13344 ) -> Result<Self, ::mavlink_core::error::ParserError> {
13345 let avail_len = __input.len();
13346 let mut payload_buf = [0; Self::ENCODED_LEN];
13347 let mut buf = if avail_len < Self::ENCODED_LEN {
13348 payload_buf[0..avail_len].copy_from_slice(__input);
13349 Bytes::new(&payload_buf)
13350 } else {
13351 Bytes::new(__input)
13352 };
13353 let mut __struct = Self::default();
13354 __struct.time_boot_ms = buf.get_u32_le();
13355 __struct.lat = buf.get_i32_le();
13356 __struct.lon = buf.get_i32_le();
13357 __struct.alt = buf.get_i32_le();
13358 __struct.relative_alt = buf.get_i32_le();
13359 __struct.vx = buf.get_i16_le();
13360 __struct.vy = buf.get_i16_le();
13361 __struct.vz = buf.get_i16_le();
13362 __struct.hdg = buf.get_u16_le();
13363 Ok(__struct)
13364 }
13365 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
13366 let mut __tmp = BytesMut::new(bytes);
13367 #[allow(clippy::absurd_extreme_comparisons)]
13368 #[allow(unused_comparisons)]
13369 if __tmp.remaining() < Self::ENCODED_LEN {
13370 panic!(
13371 "buffer is too small (need {} bytes, but got {})",
13372 Self::ENCODED_LEN,
13373 __tmp.remaining(),
13374 )
13375 }
13376 __tmp.put_u32_le(self.time_boot_ms);
13377 __tmp.put_i32_le(self.lat);
13378 __tmp.put_i32_le(self.lon);
13379 __tmp.put_i32_le(self.alt);
13380 __tmp.put_i32_le(self.relative_alt);
13381 __tmp.put_i16_le(self.vx);
13382 __tmp.put_i16_le(self.vy);
13383 __tmp.put_i16_le(self.vz);
13384 __tmp.put_u16_le(self.hdg);
13385 if matches!(version, MavlinkVersion::V2) {
13386 let len = __tmp.len();
13387 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
13388 } else {
13389 __tmp.len()
13390 }
13391 }
13392}
13393#[doc = "The filtered global position (e.g. fused GPS and accelerometers). The position is in GPS-frame (right-handed, Z-up). It is designed as scaled integer message since the resolution of float is not sufficient. NOTE: This message is intended for onboard networks / companion computers and higher-bandwidth links and optimized for accuracy and completeness. Please use the GLOBAL_POSITION_INT message for a minimal subset."]
13394#[doc = ""]
13395#[doc = "ID: 63"]
13396#[derive(Debug, Clone, PartialEq)]
13397#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
13398#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
13399pub struct GLOBAL_POSITION_INT_COV_DATA {
13400 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
13401 pub time_usec: u64,
13402 #[doc = "Latitude"]
13403 pub lat: i32,
13404 #[doc = "Longitude"]
13405 pub lon: i32,
13406 #[doc = "Altitude in meters above MSL"]
13407 pub alt: i32,
13408 #[doc = "Altitude above ground"]
13409 pub relative_alt: i32,
13410 #[doc = "Ground X Speed (Latitude)"]
13411 pub vx: f32,
13412 #[doc = "Ground Y Speed (Longitude)"]
13413 pub vy: f32,
13414 #[doc = "Ground Z Speed (Altitude)"]
13415 pub vz: f32,
13416 #[doc = "Row-major representation of a 6x6 position and velocity 6x6 cross-covariance matrix (states: lat, lon, alt, vx, vy, vz; first six entries are the first ROW, next six entries are the second row, etc.). If unknown, assign NaN value to first element in the array."]
13417 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
13418 pub covariance: [f32; 36],
13419 #[doc = "Class id of the estimator this estimate originated from."]
13420 pub estimator_type: MavEstimatorType,
13421}
13422impl GLOBAL_POSITION_INT_COV_DATA {
13423 pub const ENCODED_LEN: usize = 181usize;
13424 pub const DEFAULT: Self = Self {
13425 time_usec: 0_u64,
13426 lat: 0_i32,
13427 lon: 0_i32,
13428 alt: 0_i32,
13429 relative_alt: 0_i32,
13430 vx: 0.0_f32,
13431 vy: 0.0_f32,
13432 vz: 0.0_f32,
13433 covariance: [0.0_f32; 36usize],
13434 estimator_type: MavEstimatorType::DEFAULT,
13435 };
13436 #[cfg(feature = "arbitrary")]
13437 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
13438 use arbitrary::{Arbitrary, Unstructured};
13439 let mut buf = [0u8; 1024];
13440 rng.fill_bytes(&mut buf);
13441 let mut unstructured = Unstructured::new(&buf);
13442 Self::arbitrary(&mut unstructured).unwrap_or_default()
13443 }
13444}
13445impl Default for GLOBAL_POSITION_INT_COV_DATA {
13446 fn default() -> Self {
13447 Self::DEFAULT.clone()
13448 }
13449}
13450impl MessageData for GLOBAL_POSITION_INT_COV_DATA {
13451 type Message = MavMessage;
13452 const ID: u32 = 63u32;
13453 const NAME: &'static str = "GLOBAL_POSITION_INT_COV";
13454 const EXTRA_CRC: u8 = 119u8;
13455 const ENCODED_LEN: usize = 181usize;
13456 fn deser(
13457 _version: MavlinkVersion,
13458 __input: &[u8],
13459 ) -> Result<Self, ::mavlink_core::error::ParserError> {
13460 let avail_len = __input.len();
13461 let mut payload_buf = [0; Self::ENCODED_LEN];
13462 let mut buf = if avail_len < Self::ENCODED_LEN {
13463 payload_buf[0..avail_len].copy_from_slice(__input);
13464 Bytes::new(&payload_buf)
13465 } else {
13466 Bytes::new(__input)
13467 };
13468 let mut __struct = Self::default();
13469 __struct.time_usec = buf.get_u64_le();
13470 __struct.lat = buf.get_i32_le();
13471 __struct.lon = buf.get_i32_le();
13472 __struct.alt = buf.get_i32_le();
13473 __struct.relative_alt = buf.get_i32_le();
13474 __struct.vx = buf.get_f32_le();
13475 __struct.vy = buf.get_f32_le();
13476 __struct.vz = buf.get_f32_le();
13477 for v in &mut __struct.covariance {
13478 let val = buf.get_f32_le();
13479 *v = val;
13480 }
13481 let tmp = buf.get_u8();
13482 __struct.estimator_type =
13483 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
13484 enum_type: "MavEstimatorType",
13485 value: tmp as u32,
13486 })?;
13487 Ok(__struct)
13488 }
13489 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
13490 let mut __tmp = BytesMut::new(bytes);
13491 #[allow(clippy::absurd_extreme_comparisons)]
13492 #[allow(unused_comparisons)]
13493 if __tmp.remaining() < Self::ENCODED_LEN {
13494 panic!(
13495 "buffer is too small (need {} bytes, but got {})",
13496 Self::ENCODED_LEN,
13497 __tmp.remaining(),
13498 )
13499 }
13500 __tmp.put_u64_le(self.time_usec);
13501 __tmp.put_i32_le(self.lat);
13502 __tmp.put_i32_le(self.lon);
13503 __tmp.put_i32_le(self.alt);
13504 __tmp.put_i32_le(self.relative_alt);
13505 __tmp.put_f32_le(self.vx);
13506 __tmp.put_f32_le(self.vy);
13507 __tmp.put_f32_le(self.vz);
13508 for val in &self.covariance {
13509 __tmp.put_f32_le(*val);
13510 }
13511 __tmp.put_u8(self.estimator_type as u8);
13512 if matches!(version, MavlinkVersion::V2) {
13513 let len = __tmp.len();
13514 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
13515 } else {
13516 __tmp.len()
13517 }
13518 }
13519}
13520#[doc = "Global position/attitude estimate from a vision source."]
13521#[doc = ""]
13522#[doc = "ID: 101"]
13523#[derive(Debug, Clone, PartialEq)]
13524#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
13525#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
13526pub struct GLOBAL_VISION_POSITION_ESTIMATE_DATA {
13527 #[doc = "Timestamp (UNIX time or since system boot)"]
13528 pub usec: u64,
13529 #[doc = "Global X position"]
13530 pub x: f32,
13531 #[doc = "Global Y position"]
13532 pub y: f32,
13533 #[doc = "Global Z position"]
13534 pub z: f32,
13535 #[doc = "Roll angle"]
13536 pub roll: f32,
13537 #[doc = "Pitch angle"]
13538 pub pitch: f32,
13539 #[doc = "Yaw angle"]
13540 pub yaw: f32,
13541 #[doc = "Row-major representation of pose 6x6 cross-covariance matrix upper right triangle (states: x_global, y_global, z_global, roll, pitch, yaw; first six entries are the first ROW, next five entries are the second ROW, etc.). If unknown, assign NaN value to first element in the array."]
13542 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
13543 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
13544 pub covariance: [f32; 21],
13545 #[doc = "Estimate reset counter. This should be incremented when the estimate resets in any of the dimensions (position, velocity, attitude, angular speed). This is designed to be used when e.g an external SLAM system detects a loop-closure and the estimate jumps."]
13546 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
13547 pub reset_counter: u8,
13548}
13549impl GLOBAL_VISION_POSITION_ESTIMATE_DATA {
13550 pub const ENCODED_LEN: usize = 117usize;
13551 pub const DEFAULT: Self = Self {
13552 usec: 0_u64,
13553 x: 0.0_f32,
13554 y: 0.0_f32,
13555 z: 0.0_f32,
13556 roll: 0.0_f32,
13557 pitch: 0.0_f32,
13558 yaw: 0.0_f32,
13559 covariance: [0.0_f32; 21usize],
13560 reset_counter: 0_u8,
13561 };
13562 #[cfg(feature = "arbitrary")]
13563 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
13564 use arbitrary::{Arbitrary, Unstructured};
13565 let mut buf = [0u8; 1024];
13566 rng.fill_bytes(&mut buf);
13567 let mut unstructured = Unstructured::new(&buf);
13568 Self::arbitrary(&mut unstructured).unwrap_or_default()
13569 }
13570}
13571impl Default for GLOBAL_VISION_POSITION_ESTIMATE_DATA {
13572 fn default() -> Self {
13573 Self::DEFAULT.clone()
13574 }
13575}
13576impl MessageData for GLOBAL_VISION_POSITION_ESTIMATE_DATA {
13577 type Message = MavMessage;
13578 const ID: u32 = 101u32;
13579 const NAME: &'static str = "GLOBAL_VISION_POSITION_ESTIMATE";
13580 const EXTRA_CRC: u8 = 102u8;
13581 const ENCODED_LEN: usize = 117usize;
13582 fn deser(
13583 _version: MavlinkVersion,
13584 __input: &[u8],
13585 ) -> Result<Self, ::mavlink_core::error::ParserError> {
13586 let avail_len = __input.len();
13587 let mut payload_buf = [0; Self::ENCODED_LEN];
13588 let mut buf = if avail_len < Self::ENCODED_LEN {
13589 payload_buf[0..avail_len].copy_from_slice(__input);
13590 Bytes::new(&payload_buf)
13591 } else {
13592 Bytes::new(__input)
13593 };
13594 let mut __struct = Self::default();
13595 __struct.usec = buf.get_u64_le();
13596 __struct.x = buf.get_f32_le();
13597 __struct.y = buf.get_f32_le();
13598 __struct.z = buf.get_f32_le();
13599 __struct.roll = buf.get_f32_le();
13600 __struct.pitch = buf.get_f32_le();
13601 __struct.yaw = buf.get_f32_le();
13602 for v in &mut __struct.covariance {
13603 let val = buf.get_f32_le();
13604 *v = val;
13605 }
13606 __struct.reset_counter = buf.get_u8();
13607 Ok(__struct)
13608 }
13609 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
13610 let mut __tmp = BytesMut::new(bytes);
13611 #[allow(clippy::absurd_extreme_comparisons)]
13612 #[allow(unused_comparisons)]
13613 if __tmp.remaining() < Self::ENCODED_LEN {
13614 panic!(
13615 "buffer is too small (need {} bytes, but got {})",
13616 Self::ENCODED_LEN,
13617 __tmp.remaining(),
13618 )
13619 }
13620 __tmp.put_u64_le(self.usec);
13621 __tmp.put_f32_le(self.x);
13622 __tmp.put_f32_le(self.y);
13623 __tmp.put_f32_le(self.z);
13624 __tmp.put_f32_le(self.roll);
13625 __tmp.put_f32_le(self.pitch);
13626 __tmp.put_f32_le(self.yaw);
13627 if matches!(version, MavlinkVersion::V2) {
13628 for val in &self.covariance {
13629 __tmp.put_f32_le(*val);
13630 }
13631 __tmp.put_u8(self.reset_counter);
13632 let len = __tmp.len();
13633 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
13634 } else {
13635 __tmp.len()
13636 }
13637 }
13638}
13639#[doc = "Second GPS data."]
13640#[doc = ""]
13641#[doc = "ID: 124"]
13642#[derive(Debug, Clone, PartialEq)]
13643#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
13644#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
13645pub struct GPS2_RAW_DATA {
13646 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
13647 pub time_usec: u64,
13648 #[doc = "Latitude (WGS84)"]
13649 pub lat: i32,
13650 #[doc = "Longitude (WGS84)"]
13651 pub lon: i32,
13652 #[doc = "Altitude (MSL). Positive for up."]
13653 pub alt: i32,
13654 #[doc = "Age of DGPS info"]
13655 pub dgps_age: u32,
13656 #[doc = "GPS HDOP horizontal dilution of position (unitless * 100). If unknown, set to: UINT16_MAX"]
13657 pub eph: u16,
13658 #[doc = "GPS VDOP vertical dilution of position (unitless * 100). If unknown, set to: UINT16_MAX"]
13659 pub epv: u16,
13660 #[doc = "GPS ground speed. If unknown, set to: UINT16_MAX"]
13661 pub vel: u16,
13662 #[doc = "Course over ground (NOT heading, but direction of movement): 0.0..359.99 degrees. If unknown, set to: UINT16_MAX"]
13663 pub cog: u16,
13664 #[doc = "GPS fix type."]
13665 pub fix_type: GpsFixType,
13666 #[doc = "Number of satellites visible. If unknown, set to UINT8_MAX"]
13667 pub satellites_visible: u8,
13668 #[doc = "Number of DGPS satellites"]
13669 pub dgps_numch: u8,
13670 #[doc = "Yaw in earth frame from north. Use 0 if this GPS does not provide yaw. Use UINT16_MAX if this GPS is configured to provide yaw and is currently unable to provide it. Use 36000 for north."]
13671 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
13672 pub yaw: u16,
13673 #[doc = "Altitude (above WGS84, EGM96 ellipsoid). Positive for up."]
13674 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
13675 pub alt_ellipsoid: i32,
13676 #[doc = "Position uncertainty."]
13677 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
13678 pub h_acc: u32,
13679 #[doc = "Altitude uncertainty."]
13680 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
13681 pub v_acc: u32,
13682 #[doc = "Speed uncertainty."]
13683 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
13684 pub vel_acc: u32,
13685 #[doc = "Heading / track uncertainty"]
13686 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
13687 pub hdg_acc: u32,
13688}
13689impl GPS2_RAW_DATA {
13690 pub const ENCODED_LEN: usize = 57usize;
13691 pub const DEFAULT: Self = Self {
13692 time_usec: 0_u64,
13693 lat: 0_i32,
13694 lon: 0_i32,
13695 alt: 0_i32,
13696 dgps_age: 0_u32,
13697 eph: 0_u16,
13698 epv: 0_u16,
13699 vel: 0_u16,
13700 cog: 0_u16,
13701 fix_type: GpsFixType::DEFAULT,
13702 satellites_visible: 0_u8,
13703 dgps_numch: 0_u8,
13704 yaw: 0_u16,
13705 alt_ellipsoid: 0_i32,
13706 h_acc: 0_u32,
13707 v_acc: 0_u32,
13708 vel_acc: 0_u32,
13709 hdg_acc: 0_u32,
13710 };
13711 #[cfg(feature = "arbitrary")]
13712 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
13713 use arbitrary::{Arbitrary, Unstructured};
13714 let mut buf = [0u8; 1024];
13715 rng.fill_bytes(&mut buf);
13716 let mut unstructured = Unstructured::new(&buf);
13717 Self::arbitrary(&mut unstructured).unwrap_or_default()
13718 }
13719}
13720impl Default for GPS2_RAW_DATA {
13721 fn default() -> Self {
13722 Self::DEFAULT.clone()
13723 }
13724}
13725impl MessageData for GPS2_RAW_DATA {
13726 type Message = MavMessage;
13727 const ID: u32 = 124u32;
13728 const NAME: &'static str = "GPS2_RAW";
13729 const EXTRA_CRC: u8 = 87u8;
13730 const ENCODED_LEN: usize = 57usize;
13731 fn deser(
13732 _version: MavlinkVersion,
13733 __input: &[u8],
13734 ) -> Result<Self, ::mavlink_core::error::ParserError> {
13735 let avail_len = __input.len();
13736 let mut payload_buf = [0; Self::ENCODED_LEN];
13737 let mut buf = if avail_len < Self::ENCODED_LEN {
13738 payload_buf[0..avail_len].copy_from_slice(__input);
13739 Bytes::new(&payload_buf)
13740 } else {
13741 Bytes::new(__input)
13742 };
13743 let mut __struct = Self::default();
13744 __struct.time_usec = buf.get_u64_le();
13745 __struct.lat = buf.get_i32_le();
13746 __struct.lon = buf.get_i32_le();
13747 __struct.alt = buf.get_i32_le();
13748 __struct.dgps_age = buf.get_u32_le();
13749 __struct.eph = buf.get_u16_le();
13750 __struct.epv = buf.get_u16_le();
13751 __struct.vel = buf.get_u16_le();
13752 __struct.cog = buf.get_u16_le();
13753 let tmp = buf.get_u8();
13754 __struct.fix_type =
13755 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
13756 enum_type: "GpsFixType",
13757 value: tmp as u32,
13758 })?;
13759 __struct.satellites_visible = buf.get_u8();
13760 __struct.dgps_numch = buf.get_u8();
13761 __struct.yaw = buf.get_u16_le();
13762 __struct.alt_ellipsoid = buf.get_i32_le();
13763 __struct.h_acc = buf.get_u32_le();
13764 __struct.v_acc = buf.get_u32_le();
13765 __struct.vel_acc = buf.get_u32_le();
13766 __struct.hdg_acc = buf.get_u32_le();
13767 Ok(__struct)
13768 }
13769 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
13770 let mut __tmp = BytesMut::new(bytes);
13771 #[allow(clippy::absurd_extreme_comparisons)]
13772 #[allow(unused_comparisons)]
13773 if __tmp.remaining() < Self::ENCODED_LEN {
13774 panic!(
13775 "buffer is too small (need {} bytes, but got {})",
13776 Self::ENCODED_LEN,
13777 __tmp.remaining(),
13778 )
13779 }
13780 __tmp.put_u64_le(self.time_usec);
13781 __tmp.put_i32_le(self.lat);
13782 __tmp.put_i32_le(self.lon);
13783 __tmp.put_i32_le(self.alt);
13784 __tmp.put_u32_le(self.dgps_age);
13785 __tmp.put_u16_le(self.eph);
13786 __tmp.put_u16_le(self.epv);
13787 __tmp.put_u16_le(self.vel);
13788 __tmp.put_u16_le(self.cog);
13789 __tmp.put_u8(self.fix_type as u8);
13790 __tmp.put_u8(self.satellites_visible);
13791 __tmp.put_u8(self.dgps_numch);
13792 if matches!(version, MavlinkVersion::V2) {
13793 __tmp.put_u16_le(self.yaw);
13794 __tmp.put_i32_le(self.alt_ellipsoid);
13795 __tmp.put_u32_le(self.h_acc);
13796 __tmp.put_u32_le(self.v_acc);
13797 __tmp.put_u32_le(self.vel_acc);
13798 __tmp.put_u32_le(self.hdg_acc);
13799 let len = __tmp.len();
13800 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
13801 } else {
13802 __tmp.len()
13803 }
13804 }
13805}
13806#[doc = "RTK GPS data. Gives information on the relative baseline calculation the GPS is reporting."]
13807#[doc = ""]
13808#[doc = "ID: 128"]
13809#[derive(Debug, Clone, PartialEq)]
13810#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
13811#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
13812pub struct GPS2_RTK_DATA {
13813 #[doc = "Time since boot of last baseline message received."]
13814 pub time_last_baseline_ms: u32,
13815 #[doc = "GPS Time of Week of last baseline"]
13816 pub tow: u32,
13817 #[doc = "Current baseline in ECEF x or NED north component."]
13818 pub baseline_a_mm: i32,
13819 #[doc = "Current baseline in ECEF y or NED east component."]
13820 pub baseline_b_mm: i32,
13821 #[doc = "Current baseline in ECEF z or NED down component."]
13822 pub baseline_c_mm: i32,
13823 #[doc = "Current estimate of baseline accuracy."]
13824 pub accuracy: u32,
13825 #[doc = "Current number of integer ambiguity hypotheses."]
13826 pub iar_num_hypotheses: i32,
13827 #[doc = "GPS Week Number of last baseline"]
13828 pub wn: u16,
13829 #[doc = "Identification of connected RTK receiver."]
13830 pub rtk_receiver_id: u8,
13831 #[doc = "GPS-specific health report for RTK data."]
13832 pub rtk_health: u8,
13833 #[doc = "Rate of baseline messages being received by GPS"]
13834 pub rtk_rate: u8,
13835 #[doc = "Current number of sats used for RTK calculation."]
13836 pub nsats: u8,
13837 #[doc = "Coordinate system of baseline"]
13838 pub baseline_coords_type: RtkBaselineCoordinateSystem,
13839}
13840impl GPS2_RTK_DATA {
13841 pub const ENCODED_LEN: usize = 35usize;
13842 pub const DEFAULT: Self = Self {
13843 time_last_baseline_ms: 0_u32,
13844 tow: 0_u32,
13845 baseline_a_mm: 0_i32,
13846 baseline_b_mm: 0_i32,
13847 baseline_c_mm: 0_i32,
13848 accuracy: 0_u32,
13849 iar_num_hypotheses: 0_i32,
13850 wn: 0_u16,
13851 rtk_receiver_id: 0_u8,
13852 rtk_health: 0_u8,
13853 rtk_rate: 0_u8,
13854 nsats: 0_u8,
13855 baseline_coords_type: RtkBaselineCoordinateSystem::DEFAULT,
13856 };
13857 #[cfg(feature = "arbitrary")]
13858 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
13859 use arbitrary::{Arbitrary, Unstructured};
13860 let mut buf = [0u8; 1024];
13861 rng.fill_bytes(&mut buf);
13862 let mut unstructured = Unstructured::new(&buf);
13863 Self::arbitrary(&mut unstructured).unwrap_or_default()
13864 }
13865}
13866impl Default for GPS2_RTK_DATA {
13867 fn default() -> Self {
13868 Self::DEFAULT.clone()
13869 }
13870}
13871impl MessageData for GPS2_RTK_DATA {
13872 type Message = MavMessage;
13873 const ID: u32 = 128u32;
13874 const NAME: &'static str = "GPS2_RTK";
13875 const EXTRA_CRC: u8 = 226u8;
13876 const ENCODED_LEN: usize = 35usize;
13877 fn deser(
13878 _version: MavlinkVersion,
13879 __input: &[u8],
13880 ) -> Result<Self, ::mavlink_core::error::ParserError> {
13881 let avail_len = __input.len();
13882 let mut payload_buf = [0; Self::ENCODED_LEN];
13883 let mut buf = if avail_len < Self::ENCODED_LEN {
13884 payload_buf[0..avail_len].copy_from_slice(__input);
13885 Bytes::new(&payload_buf)
13886 } else {
13887 Bytes::new(__input)
13888 };
13889 let mut __struct = Self::default();
13890 __struct.time_last_baseline_ms = buf.get_u32_le();
13891 __struct.tow = buf.get_u32_le();
13892 __struct.baseline_a_mm = buf.get_i32_le();
13893 __struct.baseline_b_mm = buf.get_i32_le();
13894 __struct.baseline_c_mm = buf.get_i32_le();
13895 __struct.accuracy = buf.get_u32_le();
13896 __struct.iar_num_hypotheses = buf.get_i32_le();
13897 __struct.wn = buf.get_u16_le();
13898 __struct.rtk_receiver_id = buf.get_u8();
13899 __struct.rtk_health = buf.get_u8();
13900 __struct.rtk_rate = buf.get_u8();
13901 __struct.nsats = buf.get_u8();
13902 let tmp = buf.get_u8();
13903 __struct.baseline_coords_type =
13904 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
13905 enum_type: "RtkBaselineCoordinateSystem",
13906 value: tmp as u32,
13907 })?;
13908 Ok(__struct)
13909 }
13910 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
13911 let mut __tmp = BytesMut::new(bytes);
13912 #[allow(clippy::absurd_extreme_comparisons)]
13913 #[allow(unused_comparisons)]
13914 if __tmp.remaining() < Self::ENCODED_LEN {
13915 panic!(
13916 "buffer is too small (need {} bytes, but got {})",
13917 Self::ENCODED_LEN,
13918 __tmp.remaining(),
13919 )
13920 }
13921 __tmp.put_u32_le(self.time_last_baseline_ms);
13922 __tmp.put_u32_le(self.tow);
13923 __tmp.put_i32_le(self.baseline_a_mm);
13924 __tmp.put_i32_le(self.baseline_b_mm);
13925 __tmp.put_i32_le(self.baseline_c_mm);
13926 __tmp.put_u32_le(self.accuracy);
13927 __tmp.put_i32_le(self.iar_num_hypotheses);
13928 __tmp.put_u16_le(self.wn);
13929 __tmp.put_u8(self.rtk_receiver_id);
13930 __tmp.put_u8(self.rtk_health);
13931 __tmp.put_u8(self.rtk_rate);
13932 __tmp.put_u8(self.nsats);
13933 __tmp.put_u8(self.baseline_coords_type as u8);
13934 if matches!(version, MavlinkVersion::V2) {
13935 let len = __tmp.len();
13936 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
13937 } else {
13938 __tmp.len()
13939 }
13940 }
13941}
13942#[doc = "Publishes the GPS coordinates of the vehicle local origin (0,0,0) position. Emitted whenever a new GPS-Local position mapping is requested or set - e.g. following SET_GPS_GLOBAL_ORIGIN message."]
13943#[doc = ""]
13944#[doc = "ID: 49"]
13945#[derive(Debug, Clone, PartialEq)]
13946#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
13947#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
13948pub struct GPS_GLOBAL_ORIGIN_DATA {
13949 #[doc = "Latitude (WGS84)"]
13950 pub latitude: i32,
13951 #[doc = "Longitude (WGS84)"]
13952 pub longitude: i32,
13953 #[doc = "Altitude (MSL). Positive for up."]
13954 pub altitude: i32,
13955 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
13956 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
13957 pub time_usec: u64,
13958}
13959impl GPS_GLOBAL_ORIGIN_DATA {
13960 pub const ENCODED_LEN: usize = 20usize;
13961 pub const DEFAULT: Self = Self {
13962 latitude: 0_i32,
13963 longitude: 0_i32,
13964 altitude: 0_i32,
13965 time_usec: 0_u64,
13966 };
13967 #[cfg(feature = "arbitrary")]
13968 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
13969 use arbitrary::{Arbitrary, Unstructured};
13970 let mut buf = [0u8; 1024];
13971 rng.fill_bytes(&mut buf);
13972 let mut unstructured = Unstructured::new(&buf);
13973 Self::arbitrary(&mut unstructured).unwrap_or_default()
13974 }
13975}
13976impl Default for GPS_GLOBAL_ORIGIN_DATA {
13977 fn default() -> Self {
13978 Self::DEFAULT.clone()
13979 }
13980}
13981impl MessageData for GPS_GLOBAL_ORIGIN_DATA {
13982 type Message = MavMessage;
13983 const ID: u32 = 49u32;
13984 const NAME: &'static str = "GPS_GLOBAL_ORIGIN";
13985 const EXTRA_CRC: u8 = 39u8;
13986 const ENCODED_LEN: usize = 20usize;
13987 fn deser(
13988 _version: MavlinkVersion,
13989 __input: &[u8],
13990 ) -> Result<Self, ::mavlink_core::error::ParserError> {
13991 let avail_len = __input.len();
13992 let mut payload_buf = [0; Self::ENCODED_LEN];
13993 let mut buf = if avail_len < Self::ENCODED_LEN {
13994 payload_buf[0..avail_len].copy_from_slice(__input);
13995 Bytes::new(&payload_buf)
13996 } else {
13997 Bytes::new(__input)
13998 };
13999 let mut __struct = Self::default();
14000 __struct.latitude = buf.get_i32_le();
14001 __struct.longitude = buf.get_i32_le();
14002 __struct.altitude = buf.get_i32_le();
14003 __struct.time_usec = buf.get_u64_le();
14004 Ok(__struct)
14005 }
14006 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
14007 let mut __tmp = BytesMut::new(bytes);
14008 #[allow(clippy::absurd_extreme_comparisons)]
14009 #[allow(unused_comparisons)]
14010 if __tmp.remaining() < Self::ENCODED_LEN {
14011 panic!(
14012 "buffer is too small (need {} bytes, but got {})",
14013 Self::ENCODED_LEN,
14014 __tmp.remaining(),
14015 )
14016 }
14017 __tmp.put_i32_le(self.latitude);
14018 __tmp.put_i32_le(self.longitude);
14019 __tmp.put_i32_le(self.altitude);
14020 if matches!(version, MavlinkVersion::V2) {
14021 __tmp.put_u64_le(self.time_usec);
14022 let len = __tmp.len();
14023 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
14024 } else {
14025 __tmp.len()
14026 }
14027 }
14028}
14029#[deprecated = " See `GPS_RTCM_DATA` (Deprecated since 2022-05)"]
14030#[doc = "Data for injecting into the onboard GPS (used for DGPS)."]
14031#[doc = ""]
14032#[doc = "ID: 123"]
14033#[derive(Debug, Clone, PartialEq)]
14034#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
14035#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
14036pub struct GPS_INJECT_DATA_DATA {
14037 #[doc = "System ID"]
14038 pub target_system: u8,
14039 #[doc = "Component ID"]
14040 pub target_component: u8,
14041 #[doc = "Data length"]
14042 pub len: u8,
14043 #[doc = "Raw data (110 is enough for 12 satellites of RTCMv2)"]
14044 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
14045 pub data: [u8; 110],
14046}
14047impl GPS_INJECT_DATA_DATA {
14048 pub const ENCODED_LEN: usize = 113usize;
14049 pub const DEFAULT: Self = Self {
14050 target_system: 0_u8,
14051 target_component: 0_u8,
14052 len: 0_u8,
14053 data: [0_u8; 110usize],
14054 };
14055 #[cfg(feature = "arbitrary")]
14056 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
14057 use arbitrary::{Arbitrary, Unstructured};
14058 let mut buf = [0u8; 1024];
14059 rng.fill_bytes(&mut buf);
14060 let mut unstructured = Unstructured::new(&buf);
14061 Self::arbitrary(&mut unstructured).unwrap_or_default()
14062 }
14063}
14064impl Default for GPS_INJECT_DATA_DATA {
14065 fn default() -> Self {
14066 Self::DEFAULT.clone()
14067 }
14068}
14069impl MessageData for GPS_INJECT_DATA_DATA {
14070 type Message = MavMessage;
14071 const ID: u32 = 123u32;
14072 const NAME: &'static str = "GPS_INJECT_DATA";
14073 const EXTRA_CRC: u8 = 250u8;
14074 const ENCODED_LEN: usize = 113usize;
14075 fn deser(
14076 _version: MavlinkVersion,
14077 __input: &[u8],
14078 ) -> Result<Self, ::mavlink_core::error::ParserError> {
14079 let avail_len = __input.len();
14080 let mut payload_buf = [0; Self::ENCODED_LEN];
14081 let mut buf = if avail_len < Self::ENCODED_LEN {
14082 payload_buf[0..avail_len].copy_from_slice(__input);
14083 Bytes::new(&payload_buf)
14084 } else {
14085 Bytes::new(__input)
14086 };
14087 let mut __struct = Self::default();
14088 __struct.target_system = buf.get_u8();
14089 __struct.target_component = buf.get_u8();
14090 __struct.len = buf.get_u8();
14091 for v in &mut __struct.data {
14092 let val = buf.get_u8();
14093 *v = val;
14094 }
14095 Ok(__struct)
14096 }
14097 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
14098 let mut __tmp = BytesMut::new(bytes);
14099 #[allow(clippy::absurd_extreme_comparisons)]
14100 #[allow(unused_comparisons)]
14101 if __tmp.remaining() < Self::ENCODED_LEN {
14102 panic!(
14103 "buffer is too small (need {} bytes, but got {})",
14104 Self::ENCODED_LEN,
14105 __tmp.remaining(),
14106 )
14107 }
14108 __tmp.put_u8(self.target_system);
14109 __tmp.put_u8(self.target_component);
14110 __tmp.put_u8(self.len);
14111 for val in &self.data {
14112 __tmp.put_u8(*val);
14113 }
14114 if matches!(version, MavlinkVersion::V2) {
14115 let len = __tmp.len();
14116 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
14117 } else {
14118 __tmp.len()
14119 }
14120 }
14121}
14122#[doc = "GPS sensor input message. This is a raw sensor value sent by the GPS. This is NOT the global position estimate of the system."]
14123#[doc = ""]
14124#[doc = "ID: 232"]
14125#[derive(Debug, Clone, PartialEq)]
14126#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
14127#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
14128pub struct GPS_INPUT_DATA {
14129 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
14130 pub time_usec: u64,
14131 #[doc = "GPS time (from start of GPS week)"]
14132 pub time_week_ms: u32,
14133 #[doc = "Latitude (WGS84)"]
14134 pub lat: i32,
14135 #[doc = "Longitude (WGS84)"]
14136 pub lon: i32,
14137 #[doc = "Altitude (MSL). Positive for up."]
14138 pub alt: f32,
14139 #[doc = "GPS HDOP horizontal dilution of position (unitless). If unknown, set to: UINT16_MAX"]
14140 pub hdop: f32,
14141 #[doc = "GPS VDOP vertical dilution of position (unitless). If unknown, set to: UINT16_MAX"]
14142 pub vdop: f32,
14143 #[doc = "GPS velocity in north direction in earth-fixed NED frame"]
14144 pub vn: f32,
14145 #[doc = "GPS velocity in east direction in earth-fixed NED frame"]
14146 pub ve: f32,
14147 #[doc = "GPS velocity in down direction in earth-fixed NED frame"]
14148 pub vd: f32,
14149 #[doc = "GPS speed accuracy"]
14150 pub speed_accuracy: f32,
14151 #[doc = "GPS horizontal accuracy"]
14152 pub horiz_accuracy: f32,
14153 #[doc = "GPS vertical accuracy"]
14154 pub vert_accuracy: f32,
14155 #[doc = "Bitmap indicating which GPS input flags fields to ignore. All other fields must be provided."]
14156 pub ignore_flags: GpsInputIgnoreFlags,
14157 #[doc = "GPS week number"]
14158 pub time_week: u16,
14159 #[doc = "ID of the GPS for multiple GPS inputs"]
14160 pub gps_id: u8,
14161 #[doc = "0-1: no fix, 2: 2D fix, 3: 3D fix. 4: 3D with DGPS. 5: 3D with RTK"]
14162 pub fix_type: u8,
14163 #[doc = "Number of satellites visible."]
14164 pub satellites_visible: u8,
14165 #[doc = "Yaw of vehicle relative to Earth's North, zero means not available, use 36000 for north"]
14166 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
14167 pub yaw: u16,
14168}
14169impl GPS_INPUT_DATA {
14170 pub const ENCODED_LEN: usize = 65usize;
14171 pub const DEFAULT: Self = Self {
14172 time_usec: 0_u64,
14173 time_week_ms: 0_u32,
14174 lat: 0_i32,
14175 lon: 0_i32,
14176 alt: 0.0_f32,
14177 hdop: 0.0_f32,
14178 vdop: 0.0_f32,
14179 vn: 0.0_f32,
14180 ve: 0.0_f32,
14181 vd: 0.0_f32,
14182 speed_accuracy: 0.0_f32,
14183 horiz_accuracy: 0.0_f32,
14184 vert_accuracy: 0.0_f32,
14185 ignore_flags: GpsInputIgnoreFlags::DEFAULT,
14186 time_week: 0_u16,
14187 gps_id: 0_u8,
14188 fix_type: 0_u8,
14189 satellites_visible: 0_u8,
14190 yaw: 0_u16,
14191 };
14192 #[cfg(feature = "arbitrary")]
14193 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
14194 use arbitrary::{Arbitrary, Unstructured};
14195 let mut buf = [0u8; 1024];
14196 rng.fill_bytes(&mut buf);
14197 let mut unstructured = Unstructured::new(&buf);
14198 Self::arbitrary(&mut unstructured).unwrap_or_default()
14199 }
14200}
14201impl Default for GPS_INPUT_DATA {
14202 fn default() -> Self {
14203 Self::DEFAULT.clone()
14204 }
14205}
14206impl MessageData for GPS_INPUT_DATA {
14207 type Message = MavMessage;
14208 const ID: u32 = 232u32;
14209 const NAME: &'static str = "GPS_INPUT";
14210 const EXTRA_CRC: u8 = 151u8;
14211 const ENCODED_LEN: usize = 65usize;
14212 fn deser(
14213 _version: MavlinkVersion,
14214 __input: &[u8],
14215 ) -> Result<Self, ::mavlink_core::error::ParserError> {
14216 let avail_len = __input.len();
14217 let mut payload_buf = [0; Self::ENCODED_LEN];
14218 let mut buf = if avail_len < Self::ENCODED_LEN {
14219 payload_buf[0..avail_len].copy_from_slice(__input);
14220 Bytes::new(&payload_buf)
14221 } else {
14222 Bytes::new(__input)
14223 };
14224 let mut __struct = Self::default();
14225 __struct.time_usec = buf.get_u64_le();
14226 __struct.time_week_ms = buf.get_u32_le();
14227 __struct.lat = buf.get_i32_le();
14228 __struct.lon = buf.get_i32_le();
14229 __struct.alt = buf.get_f32_le();
14230 __struct.hdop = buf.get_f32_le();
14231 __struct.vdop = buf.get_f32_le();
14232 __struct.vn = buf.get_f32_le();
14233 __struct.ve = buf.get_f32_le();
14234 __struct.vd = buf.get_f32_le();
14235 __struct.speed_accuracy = buf.get_f32_le();
14236 __struct.horiz_accuracy = buf.get_f32_le();
14237 __struct.vert_accuracy = buf.get_f32_le();
14238 let tmp = buf.get_u16_le();
14239 __struct.ignore_flags = GpsInputIgnoreFlags::from_bits(
14240 tmp & GpsInputIgnoreFlags::all().bits(),
14241 )
14242 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
14243 flag_type: "GpsInputIgnoreFlags",
14244 value: tmp as u32,
14245 })?;
14246 __struct.time_week = buf.get_u16_le();
14247 __struct.gps_id = buf.get_u8();
14248 __struct.fix_type = buf.get_u8();
14249 __struct.satellites_visible = buf.get_u8();
14250 __struct.yaw = buf.get_u16_le();
14251 Ok(__struct)
14252 }
14253 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
14254 let mut __tmp = BytesMut::new(bytes);
14255 #[allow(clippy::absurd_extreme_comparisons)]
14256 #[allow(unused_comparisons)]
14257 if __tmp.remaining() < Self::ENCODED_LEN {
14258 panic!(
14259 "buffer is too small (need {} bytes, but got {})",
14260 Self::ENCODED_LEN,
14261 __tmp.remaining(),
14262 )
14263 }
14264 __tmp.put_u64_le(self.time_usec);
14265 __tmp.put_u32_le(self.time_week_ms);
14266 __tmp.put_i32_le(self.lat);
14267 __tmp.put_i32_le(self.lon);
14268 __tmp.put_f32_le(self.alt);
14269 __tmp.put_f32_le(self.hdop);
14270 __tmp.put_f32_le(self.vdop);
14271 __tmp.put_f32_le(self.vn);
14272 __tmp.put_f32_le(self.ve);
14273 __tmp.put_f32_le(self.vd);
14274 __tmp.put_f32_le(self.speed_accuracy);
14275 __tmp.put_f32_le(self.horiz_accuracy);
14276 __tmp.put_f32_le(self.vert_accuracy);
14277 __tmp.put_u16_le(self.ignore_flags.bits());
14278 __tmp.put_u16_le(self.time_week);
14279 __tmp.put_u8(self.gps_id);
14280 __tmp.put_u8(self.fix_type);
14281 __tmp.put_u8(self.satellites_visible);
14282 if matches!(version, MavlinkVersion::V2) {
14283 __tmp.put_u16_le(self.yaw);
14284 let len = __tmp.len();
14285 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
14286 } else {
14287 __tmp.len()
14288 }
14289 }
14290}
14291#[doc = "The global position, as returned by the Global Positioning System (GPS). This is NOT the global position estimate of the system, but rather a RAW sensor value. See message GLOBAL_POSITION_INT for the global position estimate."]
14292#[doc = ""]
14293#[doc = "ID: 24"]
14294#[derive(Debug, Clone, PartialEq)]
14295#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
14296#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
14297pub struct GPS_RAW_INT_DATA {
14298 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
14299 pub time_usec: u64,
14300 #[doc = "Latitude (WGS84, EGM96 ellipsoid)"]
14301 pub lat: i32,
14302 #[doc = "Longitude (WGS84, EGM96 ellipsoid)"]
14303 pub lon: i32,
14304 #[doc = "Altitude (MSL). Positive for up. Note that virtually all GPS modules provide the MSL altitude in addition to the WGS84 altitude."]
14305 pub alt: i32,
14306 #[doc = "GPS HDOP horizontal dilution of position (unitless * 100). If unknown, set to: UINT16_MAX"]
14307 pub eph: u16,
14308 #[doc = "GPS VDOP vertical dilution of position (unitless * 100). If unknown, set to: UINT16_MAX"]
14309 pub epv: u16,
14310 #[doc = "GPS ground speed. If unknown, set to: UINT16_MAX"]
14311 pub vel: u16,
14312 #[doc = "Course over ground (NOT heading, but direction of movement) in degrees * 100, 0.0..359.99 degrees. If unknown, set to: UINT16_MAX"]
14313 pub cog: u16,
14314 #[doc = "GPS fix type."]
14315 pub fix_type: GpsFixType,
14316 #[doc = "Number of satellites visible. If unknown, set to UINT8_MAX"]
14317 pub satellites_visible: u8,
14318 #[doc = "Altitude (above WGS84, EGM96 ellipsoid). Positive for up."]
14319 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
14320 pub alt_ellipsoid: i32,
14321 #[doc = "Position uncertainty."]
14322 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
14323 pub h_acc: u32,
14324 #[doc = "Altitude uncertainty."]
14325 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
14326 pub v_acc: u32,
14327 #[doc = "Speed uncertainty."]
14328 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
14329 pub vel_acc: u32,
14330 #[doc = "Heading / track uncertainty"]
14331 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
14332 pub hdg_acc: u32,
14333 #[doc = "Yaw in earth frame from north. Use 0 if this GPS does not provide yaw. Use UINT16_MAX if this GPS is configured to provide yaw and is currently unable to provide it. Use 36000 for north."]
14334 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
14335 pub yaw: u16,
14336}
14337impl GPS_RAW_INT_DATA {
14338 pub const ENCODED_LEN: usize = 52usize;
14339 pub const DEFAULT: Self = Self {
14340 time_usec: 0_u64,
14341 lat: 0_i32,
14342 lon: 0_i32,
14343 alt: 0_i32,
14344 eph: 0_u16,
14345 epv: 0_u16,
14346 vel: 0_u16,
14347 cog: 0_u16,
14348 fix_type: GpsFixType::DEFAULT,
14349 satellites_visible: 0_u8,
14350 alt_ellipsoid: 0_i32,
14351 h_acc: 0_u32,
14352 v_acc: 0_u32,
14353 vel_acc: 0_u32,
14354 hdg_acc: 0_u32,
14355 yaw: 0_u16,
14356 };
14357 #[cfg(feature = "arbitrary")]
14358 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
14359 use arbitrary::{Arbitrary, Unstructured};
14360 let mut buf = [0u8; 1024];
14361 rng.fill_bytes(&mut buf);
14362 let mut unstructured = Unstructured::new(&buf);
14363 Self::arbitrary(&mut unstructured).unwrap_or_default()
14364 }
14365}
14366impl Default for GPS_RAW_INT_DATA {
14367 fn default() -> Self {
14368 Self::DEFAULT.clone()
14369 }
14370}
14371impl MessageData for GPS_RAW_INT_DATA {
14372 type Message = MavMessage;
14373 const ID: u32 = 24u32;
14374 const NAME: &'static str = "GPS_RAW_INT";
14375 const EXTRA_CRC: u8 = 24u8;
14376 const ENCODED_LEN: usize = 52usize;
14377 fn deser(
14378 _version: MavlinkVersion,
14379 __input: &[u8],
14380 ) -> Result<Self, ::mavlink_core::error::ParserError> {
14381 let avail_len = __input.len();
14382 let mut payload_buf = [0; Self::ENCODED_LEN];
14383 let mut buf = if avail_len < Self::ENCODED_LEN {
14384 payload_buf[0..avail_len].copy_from_slice(__input);
14385 Bytes::new(&payload_buf)
14386 } else {
14387 Bytes::new(__input)
14388 };
14389 let mut __struct = Self::default();
14390 __struct.time_usec = buf.get_u64_le();
14391 __struct.lat = buf.get_i32_le();
14392 __struct.lon = buf.get_i32_le();
14393 __struct.alt = buf.get_i32_le();
14394 __struct.eph = buf.get_u16_le();
14395 __struct.epv = buf.get_u16_le();
14396 __struct.vel = buf.get_u16_le();
14397 __struct.cog = buf.get_u16_le();
14398 let tmp = buf.get_u8();
14399 __struct.fix_type =
14400 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
14401 enum_type: "GpsFixType",
14402 value: tmp as u32,
14403 })?;
14404 __struct.satellites_visible = buf.get_u8();
14405 __struct.alt_ellipsoid = buf.get_i32_le();
14406 __struct.h_acc = buf.get_u32_le();
14407 __struct.v_acc = buf.get_u32_le();
14408 __struct.vel_acc = buf.get_u32_le();
14409 __struct.hdg_acc = buf.get_u32_le();
14410 __struct.yaw = buf.get_u16_le();
14411 Ok(__struct)
14412 }
14413 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
14414 let mut __tmp = BytesMut::new(bytes);
14415 #[allow(clippy::absurd_extreme_comparisons)]
14416 #[allow(unused_comparisons)]
14417 if __tmp.remaining() < Self::ENCODED_LEN {
14418 panic!(
14419 "buffer is too small (need {} bytes, but got {})",
14420 Self::ENCODED_LEN,
14421 __tmp.remaining(),
14422 )
14423 }
14424 __tmp.put_u64_le(self.time_usec);
14425 __tmp.put_i32_le(self.lat);
14426 __tmp.put_i32_le(self.lon);
14427 __tmp.put_i32_le(self.alt);
14428 __tmp.put_u16_le(self.eph);
14429 __tmp.put_u16_le(self.epv);
14430 __tmp.put_u16_le(self.vel);
14431 __tmp.put_u16_le(self.cog);
14432 __tmp.put_u8(self.fix_type as u8);
14433 __tmp.put_u8(self.satellites_visible);
14434 if matches!(version, MavlinkVersion::V2) {
14435 __tmp.put_i32_le(self.alt_ellipsoid);
14436 __tmp.put_u32_le(self.h_acc);
14437 __tmp.put_u32_le(self.v_acc);
14438 __tmp.put_u32_le(self.vel_acc);
14439 __tmp.put_u32_le(self.hdg_acc);
14440 __tmp.put_u16_le(self.yaw);
14441 let len = __tmp.len();
14442 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
14443 } else {
14444 __tmp.len()
14445 }
14446 }
14447}
14448#[doc = "RTCM message for injecting into the onboard GPS (used for DGPS)."]
14449#[doc = ""]
14450#[doc = "ID: 233"]
14451#[derive(Debug, Clone, PartialEq)]
14452#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
14453#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
14454pub struct GPS_RTCM_DATA_DATA {
14455 #[doc = "LSB: 1 means message is fragmented, next 2 bits are the fragment ID, the remaining 5 bits are used for the sequence ID. Messages are only to be flushed to the GPS when the entire message has been reconstructed on the autopilot. The fragment ID specifies which order the fragments should be assembled into a buffer, while the sequence ID is used to detect a mismatch between different buffers. The buffer is considered fully reconstructed when either all 4 fragments are present, or all the fragments before the first fragment with a non full payload is received. This management is used to ensure that normal GPS operation doesn't corrupt RTCM data, and to recover from a unreliable transport delivery order."]
14456 pub flags: u8,
14457 #[doc = "data length"]
14458 pub len: u8,
14459 #[doc = "RTCM message (may be fragmented)"]
14460 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
14461 pub data: [u8; 180],
14462}
14463impl GPS_RTCM_DATA_DATA {
14464 pub const ENCODED_LEN: usize = 182usize;
14465 pub const DEFAULT: Self = Self {
14466 flags: 0_u8,
14467 len: 0_u8,
14468 data: [0_u8; 180usize],
14469 };
14470 #[cfg(feature = "arbitrary")]
14471 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
14472 use arbitrary::{Arbitrary, Unstructured};
14473 let mut buf = [0u8; 1024];
14474 rng.fill_bytes(&mut buf);
14475 let mut unstructured = Unstructured::new(&buf);
14476 Self::arbitrary(&mut unstructured).unwrap_or_default()
14477 }
14478}
14479impl Default for GPS_RTCM_DATA_DATA {
14480 fn default() -> Self {
14481 Self::DEFAULT.clone()
14482 }
14483}
14484impl MessageData for GPS_RTCM_DATA_DATA {
14485 type Message = MavMessage;
14486 const ID: u32 = 233u32;
14487 const NAME: &'static str = "GPS_RTCM_DATA";
14488 const EXTRA_CRC: u8 = 35u8;
14489 const ENCODED_LEN: usize = 182usize;
14490 fn deser(
14491 _version: MavlinkVersion,
14492 __input: &[u8],
14493 ) -> Result<Self, ::mavlink_core::error::ParserError> {
14494 let avail_len = __input.len();
14495 let mut payload_buf = [0; Self::ENCODED_LEN];
14496 let mut buf = if avail_len < Self::ENCODED_LEN {
14497 payload_buf[0..avail_len].copy_from_slice(__input);
14498 Bytes::new(&payload_buf)
14499 } else {
14500 Bytes::new(__input)
14501 };
14502 let mut __struct = Self::default();
14503 __struct.flags = buf.get_u8();
14504 __struct.len = buf.get_u8();
14505 for v in &mut __struct.data {
14506 let val = buf.get_u8();
14507 *v = val;
14508 }
14509 Ok(__struct)
14510 }
14511 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
14512 let mut __tmp = BytesMut::new(bytes);
14513 #[allow(clippy::absurd_extreme_comparisons)]
14514 #[allow(unused_comparisons)]
14515 if __tmp.remaining() < Self::ENCODED_LEN {
14516 panic!(
14517 "buffer is too small (need {} bytes, but got {})",
14518 Self::ENCODED_LEN,
14519 __tmp.remaining(),
14520 )
14521 }
14522 __tmp.put_u8(self.flags);
14523 __tmp.put_u8(self.len);
14524 for val in &self.data {
14525 __tmp.put_u8(*val);
14526 }
14527 if matches!(version, MavlinkVersion::V2) {
14528 let len = __tmp.len();
14529 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
14530 } else {
14531 __tmp.len()
14532 }
14533 }
14534}
14535#[doc = "RTK GPS data. Gives information on the relative baseline calculation the GPS is reporting."]
14536#[doc = ""]
14537#[doc = "ID: 127"]
14538#[derive(Debug, Clone, PartialEq)]
14539#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
14540#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
14541pub struct GPS_RTK_DATA {
14542 #[doc = "Time since boot of last baseline message received."]
14543 pub time_last_baseline_ms: u32,
14544 #[doc = "GPS Time of Week of last baseline"]
14545 pub tow: u32,
14546 #[doc = "Current baseline in ECEF x or NED north component."]
14547 pub baseline_a_mm: i32,
14548 #[doc = "Current baseline in ECEF y or NED east component."]
14549 pub baseline_b_mm: i32,
14550 #[doc = "Current baseline in ECEF z or NED down component."]
14551 pub baseline_c_mm: i32,
14552 #[doc = "Current estimate of baseline accuracy."]
14553 pub accuracy: u32,
14554 #[doc = "Current number of integer ambiguity hypotheses."]
14555 pub iar_num_hypotheses: i32,
14556 #[doc = "GPS Week Number of last baseline"]
14557 pub wn: u16,
14558 #[doc = "Identification of connected RTK receiver."]
14559 pub rtk_receiver_id: u8,
14560 #[doc = "GPS-specific health report for RTK data."]
14561 pub rtk_health: u8,
14562 #[doc = "Rate of baseline messages being received by GPS"]
14563 pub rtk_rate: u8,
14564 #[doc = "Current number of sats used for RTK calculation."]
14565 pub nsats: u8,
14566 #[doc = "Coordinate system of baseline"]
14567 pub baseline_coords_type: RtkBaselineCoordinateSystem,
14568}
14569impl GPS_RTK_DATA {
14570 pub const ENCODED_LEN: usize = 35usize;
14571 pub const DEFAULT: Self = Self {
14572 time_last_baseline_ms: 0_u32,
14573 tow: 0_u32,
14574 baseline_a_mm: 0_i32,
14575 baseline_b_mm: 0_i32,
14576 baseline_c_mm: 0_i32,
14577 accuracy: 0_u32,
14578 iar_num_hypotheses: 0_i32,
14579 wn: 0_u16,
14580 rtk_receiver_id: 0_u8,
14581 rtk_health: 0_u8,
14582 rtk_rate: 0_u8,
14583 nsats: 0_u8,
14584 baseline_coords_type: RtkBaselineCoordinateSystem::DEFAULT,
14585 };
14586 #[cfg(feature = "arbitrary")]
14587 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
14588 use arbitrary::{Arbitrary, Unstructured};
14589 let mut buf = [0u8; 1024];
14590 rng.fill_bytes(&mut buf);
14591 let mut unstructured = Unstructured::new(&buf);
14592 Self::arbitrary(&mut unstructured).unwrap_or_default()
14593 }
14594}
14595impl Default for GPS_RTK_DATA {
14596 fn default() -> Self {
14597 Self::DEFAULT.clone()
14598 }
14599}
14600impl MessageData for GPS_RTK_DATA {
14601 type Message = MavMessage;
14602 const ID: u32 = 127u32;
14603 const NAME: &'static str = "GPS_RTK";
14604 const EXTRA_CRC: u8 = 25u8;
14605 const ENCODED_LEN: usize = 35usize;
14606 fn deser(
14607 _version: MavlinkVersion,
14608 __input: &[u8],
14609 ) -> Result<Self, ::mavlink_core::error::ParserError> {
14610 let avail_len = __input.len();
14611 let mut payload_buf = [0; Self::ENCODED_LEN];
14612 let mut buf = if avail_len < Self::ENCODED_LEN {
14613 payload_buf[0..avail_len].copy_from_slice(__input);
14614 Bytes::new(&payload_buf)
14615 } else {
14616 Bytes::new(__input)
14617 };
14618 let mut __struct = Self::default();
14619 __struct.time_last_baseline_ms = buf.get_u32_le();
14620 __struct.tow = buf.get_u32_le();
14621 __struct.baseline_a_mm = buf.get_i32_le();
14622 __struct.baseline_b_mm = buf.get_i32_le();
14623 __struct.baseline_c_mm = buf.get_i32_le();
14624 __struct.accuracy = buf.get_u32_le();
14625 __struct.iar_num_hypotheses = buf.get_i32_le();
14626 __struct.wn = buf.get_u16_le();
14627 __struct.rtk_receiver_id = buf.get_u8();
14628 __struct.rtk_health = buf.get_u8();
14629 __struct.rtk_rate = buf.get_u8();
14630 __struct.nsats = buf.get_u8();
14631 let tmp = buf.get_u8();
14632 __struct.baseline_coords_type =
14633 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
14634 enum_type: "RtkBaselineCoordinateSystem",
14635 value: tmp as u32,
14636 })?;
14637 Ok(__struct)
14638 }
14639 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
14640 let mut __tmp = BytesMut::new(bytes);
14641 #[allow(clippy::absurd_extreme_comparisons)]
14642 #[allow(unused_comparisons)]
14643 if __tmp.remaining() < Self::ENCODED_LEN {
14644 panic!(
14645 "buffer is too small (need {} bytes, but got {})",
14646 Self::ENCODED_LEN,
14647 __tmp.remaining(),
14648 )
14649 }
14650 __tmp.put_u32_le(self.time_last_baseline_ms);
14651 __tmp.put_u32_le(self.tow);
14652 __tmp.put_i32_le(self.baseline_a_mm);
14653 __tmp.put_i32_le(self.baseline_b_mm);
14654 __tmp.put_i32_le(self.baseline_c_mm);
14655 __tmp.put_u32_le(self.accuracy);
14656 __tmp.put_i32_le(self.iar_num_hypotheses);
14657 __tmp.put_u16_le(self.wn);
14658 __tmp.put_u8(self.rtk_receiver_id);
14659 __tmp.put_u8(self.rtk_health);
14660 __tmp.put_u8(self.rtk_rate);
14661 __tmp.put_u8(self.nsats);
14662 __tmp.put_u8(self.baseline_coords_type as u8);
14663 if matches!(version, MavlinkVersion::V2) {
14664 let len = __tmp.len();
14665 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
14666 } else {
14667 __tmp.len()
14668 }
14669 }
14670}
14671#[doc = "The positioning status, as reported by GPS. This message is intended to display status information about each satellite visible to the receiver. See message GLOBAL_POSITION_INT for the global position estimate. This message can contain information for up to 20 satellites."]
14672#[doc = ""]
14673#[doc = "ID: 25"]
14674#[derive(Debug, Clone, PartialEq)]
14675#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
14676#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
14677pub struct GPS_STATUS_DATA {
14678 #[doc = "Number of satellites visible"]
14679 pub satellites_visible: u8,
14680 #[doc = "Global satellite ID"]
14681 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
14682 pub satellite_prn: [u8; 20],
14683 #[doc = "0: Satellite not used, 1: used for localization"]
14684 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
14685 pub satellite_used: [u8; 20],
14686 #[doc = "Elevation (0: right on top of receiver, 90: on the horizon) of satellite"]
14687 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
14688 pub satellite_elevation: [u8; 20],
14689 #[doc = "Direction of satellite, 0: 0 deg, 255: 360 deg."]
14690 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
14691 pub satellite_azimuth: [u8; 20],
14692 #[doc = "Signal to noise ratio of satellite"]
14693 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
14694 pub satellite_snr: [u8; 20],
14695}
14696impl GPS_STATUS_DATA {
14697 pub const ENCODED_LEN: usize = 101usize;
14698 pub const DEFAULT: Self = Self {
14699 satellites_visible: 0_u8,
14700 satellite_prn: [0_u8; 20usize],
14701 satellite_used: [0_u8; 20usize],
14702 satellite_elevation: [0_u8; 20usize],
14703 satellite_azimuth: [0_u8; 20usize],
14704 satellite_snr: [0_u8; 20usize],
14705 };
14706 #[cfg(feature = "arbitrary")]
14707 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
14708 use arbitrary::{Arbitrary, Unstructured};
14709 let mut buf = [0u8; 1024];
14710 rng.fill_bytes(&mut buf);
14711 let mut unstructured = Unstructured::new(&buf);
14712 Self::arbitrary(&mut unstructured).unwrap_or_default()
14713 }
14714}
14715impl Default for GPS_STATUS_DATA {
14716 fn default() -> Self {
14717 Self::DEFAULT.clone()
14718 }
14719}
14720impl MessageData for GPS_STATUS_DATA {
14721 type Message = MavMessage;
14722 const ID: u32 = 25u32;
14723 const NAME: &'static str = "GPS_STATUS";
14724 const EXTRA_CRC: u8 = 23u8;
14725 const ENCODED_LEN: usize = 101usize;
14726 fn deser(
14727 _version: MavlinkVersion,
14728 __input: &[u8],
14729 ) -> Result<Self, ::mavlink_core::error::ParserError> {
14730 let avail_len = __input.len();
14731 let mut payload_buf = [0; Self::ENCODED_LEN];
14732 let mut buf = if avail_len < Self::ENCODED_LEN {
14733 payload_buf[0..avail_len].copy_from_slice(__input);
14734 Bytes::new(&payload_buf)
14735 } else {
14736 Bytes::new(__input)
14737 };
14738 let mut __struct = Self::default();
14739 __struct.satellites_visible = buf.get_u8();
14740 for v in &mut __struct.satellite_prn {
14741 let val = buf.get_u8();
14742 *v = val;
14743 }
14744 for v in &mut __struct.satellite_used {
14745 let val = buf.get_u8();
14746 *v = val;
14747 }
14748 for v in &mut __struct.satellite_elevation {
14749 let val = buf.get_u8();
14750 *v = val;
14751 }
14752 for v in &mut __struct.satellite_azimuth {
14753 let val = buf.get_u8();
14754 *v = val;
14755 }
14756 for v in &mut __struct.satellite_snr {
14757 let val = buf.get_u8();
14758 *v = val;
14759 }
14760 Ok(__struct)
14761 }
14762 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
14763 let mut __tmp = BytesMut::new(bytes);
14764 #[allow(clippy::absurd_extreme_comparisons)]
14765 #[allow(unused_comparisons)]
14766 if __tmp.remaining() < Self::ENCODED_LEN {
14767 panic!(
14768 "buffer is too small (need {} bytes, but got {})",
14769 Self::ENCODED_LEN,
14770 __tmp.remaining(),
14771 )
14772 }
14773 __tmp.put_u8(self.satellites_visible);
14774 for val in &self.satellite_prn {
14775 __tmp.put_u8(*val);
14776 }
14777 for val in &self.satellite_used {
14778 __tmp.put_u8(*val);
14779 }
14780 for val in &self.satellite_elevation {
14781 __tmp.put_u8(*val);
14782 }
14783 for val in &self.satellite_azimuth {
14784 __tmp.put_u8(*val);
14785 }
14786 for val in &self.satellite_snr {
14787 __tmp.put_u8(*val);
14788 }
14789 if matches!(version, MavlinkVersion::V2) {
14790 let len = __tmp.len();
14791 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
14792 } else {
14793 __tmp.len()
14794 }
14795 }
14796}
14797#[doc = "The heartbeat message shows that a system or component is present and responding. The type and autopilot fields (along with the message component id), allow the receiving system to treat further messages from this system appropriately (e.g. by laying out the user interface based on the autopilot). This microservice is documented at <https://mavlink.io/en/services/heartbeat.html>."]
14798#[doc = ""]
14799#[doc = "ID: 0"]
14800#[derive(Debug, Clone, PartialEq)]
14801#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
14802#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
14803pub struct HEARTBEAT_DATA {
14804 #[doc = "A bitfield for use for autopilot-specific flags"]
14805 pub custom_mode: u32,
14806 #[doc = "Vehicle or component type. For a flight controller component the vehicle type (quadrotor, helicopter, etc.). For other components the component type (e.g. camera, gimbal, etc.). This should be used in preference to component id for identifying the component type."]
14807 pub mavtype: MavType,
14808 #[doc = "Autopilot type / class. Use MAV_AUTOPILOT_INVALID for components that are not flight controllers."]
14809 pub autopilot: MavAutopilot,
14810 #[doc = "System mode bitmap."]
14811 pub base_mode: MavModeFlag,
14812 #[doc = "System status flag."]
14813 pub system_status: MavState,
14814 #[doc = "MAVLink version, not writable by user, gets added by protocol because of magic data type: uint8_t_mavlink_version"]
14815 pub mavlink_version: u8,
14816}
14817impl HEARTBEAT_DATA {
14818 pub const ENCODED_LEN: usize = 9usize;
14819 pub const DEFAULT: Self = Self {
14820 custom_mode: 0_u32,
14821 mavtype: MavType::DEFAULT,
14822 autopilot: MavAutopilot::DEFAULT,
14823 base_mode: MavModeFlag::DEFAULT,
14824 system_status: MavState::DEFAULT,
14825 mavlink_version: MINOR_MAVLINK_VERSION,
14826 };
14827 #[cfg(feature = "arbitrary")]
14828 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
14829 use arbitrary::{Arbitrary, Unstructured};
14830 let mut buf = [0u8; 1024];
14831 rng.fill_bytes(&mut buf);
14832 let mut unstructured = Unstructured::new(&buf);
14833 Self::arbitrary(&mut unstructured).unwrap_or_default()
14834 }
14835}
14836impl Default for HEARTBEAT_DATA {
14837 fn default() -> Self {
14838 Self::DEFAULT.clone()
14839 }
14840}
14841impl MessageData for HEARTBEAT_DATA {
14842 type Message = MavMessage;
14843 const ID: u32 = 0u32;
14844 const NAME: &'static str = "HEARTBEAT";
14845 const EXTRA_CRC: u8 = 50u8;
14846 const ENCODED_LEN: usize = 9usize;
14847 fn deser(
14848 _version: MavlinkVersion,
14849 __input: &[u8],
14850 ) -> Result<Self, ::mavlink_core::error::ParserError> {
14851 let avail_len = __input.len();
14852 let mut payload_buf = [0; Self::ENCODED_LEN];
14853 let mut buf = if avail_len < Self::ENCODED_LEN {
14854 payload_buf[0..avail_len].copy_from_slice(__input);
14855 Bytes::new(&payload_buf)
14856 } else {
14857 Bytes::new(__input)
14858 };
14859 let mut __struct = Self::default();
14860 __struct.custom_mode = buf.get_u32_le();
14861 let tmp = buf.get_u8();
14862 __struct.mavtype =
14863 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
14864 enum_type: "MavType",
14865 value: tmp as u32,
14866 })?;
14867 let tmp = buf.get_u8();
14868 __struct.autopilot =
14869 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
14870 enum_type: "MavAutopilot",
14871 value: tmp as u32,
14872 })?;
14873 let tmp = buf.get_u8();
14874 __struct.base_mode = MavModeFlag::from_bits(tmp & MavModeFlag::all().bits()).ok_or(
14875 ::mavlink_core::error::ParserError::InvalidFlag {
14876 flag_type: "MavModeFlag",
14877 value: tmp as u32,
14878 },
14879 )?;
14880 let tmp = buf.get_u8();
14881 __struct.system_status =
14882 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
14883 enum_type: "MavState",
14884 value: tmp as u32,
14885 })?;
14886 __struct.mavlink_version = buf.get_u8();
14887 Ok(__struct)
14888 }
14889 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
14890 let mut __tmp = BytesMut::new(bytes);
14891 #[allow(clippy::absurd_extreme_comparisons)]
14892 #[allow(unused_comparisons)]
14893 if __tmp.remaining() < Self::ENCODED_LEN {
14894 panic!(
14895 "buffer is too small (need {} bytes, but got {})",
14896 Self::ENCODED_LEN,
14897 __tmp.remaining(),
14898 )
14899 }
14900 __tmp.put_u32_le(self.custom_mode);
14901 __tmp.put_u8(self.mavtype as u8);
14902 __tmp.put_u8(self.autopilot as u8);
14903 __tmp.put_u8(self.base_mode.bits());
14904 __tmp.put_u8(self.system_status as u8);
14905 __tmp.put_u8(self.mavlink_version);
14906 if matches!(version, MavlinkVersion::V2) {
14907 let len = __tmp.len();
14908 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
14909 } else {
14910 __tmp.len()
14911 }
14912 }
14913}
14914#[doc = "The IMU readings in SI units in NED body frame."]
14915#[doc = ""]
14916#[doc = "ID: 105"]
14917#[derive(Debug, Clone, PartialEq)]
14918#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
14919#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
14920pub struct HIGHRES_IMU_DATA {
14921 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
14922 pub time_usec: u64,
14923 #[doc = "X acceleration"]
14924 pub xacc: f32,
14925 #[doc = "Y acceleration"]
14926 pub yacc: f32,
14927 #[doc = "Z acceleration"]
14928 pub zacc: f32,
14929 #[doc = "Angular speed around X axis"]
14930 pub xgyro: f32,
14931 #[doc = "Angular speed around Y axis"]
14932 pub ygyro: f32,
14933 #[doc = "Angular speed around Z axis"]
14934 pub zgyro: f32,
14935 #[doc = "X Magnetic field"]
14936 pub xmag: f32,
14937 #[doc = "Y Magnetic field"]
14938 pub ymag: f32,
14939 #[doc = "Z Magnetic field"]
14940 pub zmag: f32,
14941 #[doc = "Absolute pressure"]
14942 pub abs_pressure: f32,
14943 #[doc = "Differential pressure"]
14944 pub diff_pressure: f32,
14945 #[doc = "Altitude calculated from pressure"]
14946 pub pressure_alt: f32,
14947 #[doc = "Temperature"]
14948 pub temperature: f32,
14949 #[doc = "Bitmap for fields that have updated since last message"]
14950 pub fields_updated: HighresImuUpdatedFlags,
14951 #[doc = "Id. Ids are numbered from 0 and map to IMUs numbered from 1 (e.g. IMU1 will have a message with id=0)"]
14952 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
14953 pub id: u8,
14954}
14955impl HIGHRES_IMU_DATA {
14956 pub const ENCODED_LEN: usize = 63usize;
14957 pub const DEFAULT: Self = Self {
14958 time_usec: 0_u64,
14959 xacc: 0.0_f32,
14960 yacc: 0.0_f32,
14961 zacc: 0.0_f32,
14962 xgyro: 0.0_f32,
14963 ygyro: 0.0_f32,
14964 zgyro: 0.0_f32,
14965 xmag: 0.0_f32,
14966 ymag: 0.0_f32,
14967 zmag: 0.0_f32,
14968 abs_pressure: 0.0_f32,
14969 diff_pressure: 0.0_f32,
14970 pressure_alt: 0.0_f32,
14971 temperature: 0.0_f32,
14972 fields_updated: HighresImuUpdatedFlags::DEFAULT,
14973 id: 0_u8,
14974 };
14975 #[cfg(feature = "arbitrary")]
14976 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
14977 use arbitrary::{Arbitrary, Unstructured};
14978 let mut buf = [0u8; 1024];
14979 rng.fill_bytes(&mut buf);
14980 let mut unstructured = Unstructured::new(&buf);
14981 Self::arbitrary(&mut unstructured).unwrap_or_default()
14982 }
14983}
14984impl Default for HIGHRES_IMU_DATA {
14985 fn default() -> Self {
14986 Self::DEFAULT.clone()
14987 }
14988}
14989impl MessageData for HIGHRES_IMU_DATA {
14990 type Message = MavMessage;
14991 const ID: u32 = 105u32;
14992 const NAME: &'static str = "HIGHRES_IMU";
14993 const EXTRA_CRC: u8 = 93u8;
14994 const ENCODED_LEN: usize = 63usize;
14995 fn deser(
14996 _version: MavlinkVersion,
14997 __input: &[u8],
14998 ) -> Result<Self, ::mavlink_core::error::ParserError> {
14999 let avail_len = __input.len();
15000 let mut payload_buf = [0; Self::ENCODED_LEN];
15001 let mut buf = if avail_len < Self::ENCODED_LEN {
15002 payload_buf[0..avail_len].copy_from_slice(__input);
15003 Bytes::new(&payload_buf)
15004 } else {
15005 Bytes::new(__input)
15006 };
15007 let mut __struct = Self::default();
15008 __struct.time_usec = buf.get_u64_le();
15009 __struct.xacc = buf.get_f32_le();
15010 __struct.yacc = buf.get_f32_le();
15011 __struct.zacc = buf.get_f32_le();
15012 __struct.xgyro = buf.get_f32_le();
15013 __struct.ygyro = buf.get_f32_le();
15014 __struct.zgyro = buf.get_f32_le();
15015 __struct.xmag = buf.get_f32_le();
15016 __struct.ymag = buf.get_f32_le();
15017 __struct.zmag = buf.get_f32_le();
15018 __struct.abs_pressure = buf.get_f32_le();
15019 __struct.diff_pressure = buf.get_f32_le();
15020 __struct.pressure_alt = buf.get_f32_le();
15021 __struct.temperature = buf.get_f32_le();
15022 let tmp = buf.get_u16_le();
15023 __struct.fields_updated = HighresImuUpdatedFlags::from_bits(
15024 tmp & HighresImuUpdatedFlags::all().bits(),
15025 )
15026 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
15027 flag_type: "HighresImuUpdatedFlags",
15028 value: tmp as u32,
15029 })?;
15030 __struct.id = buf.get_u8();
15031 Ok(__struct)
15032 }
15033 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
15034 let mut __tmp = BytesMut::new(bytes);
15035 #[allow(clippy::absurd_extreme_comparisons)]
15036 #[allow(unused_comparisons)]
15037 if __tmp.remaining() < Self::ENCODED_LEN {
15038 panic!(
15039 "buffer is too small (need {} bytes, but got {})",
15040 Self::ENCODED_LEN,
15041 __tmp.remaining(),
15042 )
15043 }
15044 __tmp.put_u64_le(self.time_usec);
15045 __tmp.put_f32_le(self.xacc);
15046 __tmp.put_f32_le(self.yacc);
15047 __tmp.put_f32_le(self.zacc);
15048 __tmp.put_f32_le(self.xgyro);
15049 __tmp.put_f32_le(self.ygyro);
15050 __tmp.put_f32_le(self.zgyro);
15051 __tmp.put_f32_le(self.xmag);
15052 __tmp.put_f32_le(self.ymag);
15053 __tmp.put_f32_le(self.zmag);
15054 __tmp.put_f32_le(self.abs_pressure);
15055 __tmp.put_f32_le(self.diff_pressure);
15056 __tmp.put_f32_le(self.pressure_alt);
15057 __tmp.put_f32_le(self.temperature);
15058 __tmp.put_u16_le(self.fields_updated.bits());
15059 if matches!(version, MavlinkVersion::V2) {
15060 __tmp.put_u8(self.id);
15061 let len = __tmp.len();
15062 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
15063 } else {
15064 __tmp.len()
15065 }
15066 }
15067}
15068#[deprecated = " See `HIGH_LATENCY2` (Deprecated since 2020-10)"]
15069#[doc = "Message appropriate for high latency connections like Iridium."]
15070#[doc = ""]
15071#[doc = "ID: 234"]
15072#[derive(Debug, Clone, PartialEq)]
15073#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
15074#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
15075pub struct HIGH_LATENCY_DATA {
15076 #[doc = "A bitfield for use for autopilot-specific flags."]
15077 pub custom_mode: u32,
15078 #[doc = "Latitude"]
15079 pub latitude: i32,
15080 #[doc = "Longitude"]
15081 pub longitude: i32,
15082 #[doc = "roll"]
15083 pub roll: i16,
15084 #[doc = "pitch"]
15085 pub pitch: i16,
15086 #[doc = "heading"]
15087 pub heading: u16,
15088 #[doc = "heading setpoint"]
15089 pub heading_sp: i16,
15090 #[doc = "Altitude above mean sea level"]
15091 pub altitude_amsl: i16,
15092 #[doc = "Altitude setpoint relative to the home position"]
15093 pub altitude_sp: i16,
15094 #[doc = "distance to target"]
15095 pub wp_distance: u16,
15096 #[doc = "Bitmap of enabled system modes."]
15097 pub base_mode: MavModeFlag,
15098 #[doc = "The landed state. Is set to MAV_LANDED_STATE_UNDEFINED if landed state is unknown."]
15099 pub landed_state: MavLandedState,
15100 #[doc = "throttle (percentage)"]
15101 pub throttle: i8,
15102 #[doc = "airspeed"]
15103 pub airspeed: u8,
15104 #[doc = "airspeed setpoint"]
15105 pub airspeed_sp: u8,
15106 #[doc = "groundspeed"]
15107 pub groundspeed: u8,
15108 #[doc = "climb rate"]
15109 pub climb_rate: i8,
15110 #[doc = "Number of satellites visible. If unknown, set to UINT8_MAX"]
15111 pub gps_nsat: u8,
15112 #[doc = "GPS Fix type."]
15113 pub gps_fix_type: GpsFixType,
15114 #[doc = "Remaining battery (percentage)"]
15115 pub battery_remaining: u8,
15116 #[doc = "Autopilot temperature (degrees C)"]
15117 pub temperature: i8,
15118 #[doc = "Air temperature (degrees C) from airspeed sensor"]
15119 pub temperature_air: i8,
15120 #[doc = "failsafe (each bit represents a failsafe where 0=ok, 1=failsafe active (bit0:RC, bit1:batt, bit2:GPS, bit3:GCS, bit4:fence)"]
15121 pub failsafe: u8,
15122 #[doc = "current waypoint number"]
15123 pub wp_num: u8,
15124}
15125impl HIGH_LATENCY_DATA {
15126 pub const ENCODED_LEN: usize = 40usize;
15127 pub const DEFAULT: Self = Self {
15128 custom_mode: 0_u32,
15129 latitude: 0_i32,
15130 longitude: 0_i32,
15131 roll: 0_i16,
15132 pitch: 0_i16,
15133 heading: 0_u16,
15134 heading_sp: 0_i16,
15135 altitude_amsl: 0_i16,
15136 altitude_sp: 0_i16,
15137 wp_distance: 0_u16,
15138 base_mode: MavModeFlag::DEFAULT,
15139 landed_state: MavLandedState::DEFAULT,
15140 throttle: 0_i8,
15141 airspeed: 0_u8,
15142 airspeed_sp: 0_u8,
15143 groundspeed: 0_u8,
15144 climb_rate: 0_i8,
15145 gps_nsat: 0_u8,
15146 gps_fix_type: GpsFixType::DEFAULT,
15147 battery_remaining: 0_u8,
15148 temperature: 0_i8,
15149 temperature_air: 0_i8,
15150 failsafe: 0_u8,
15151 wp_num: 0_u8,
15152 };
15153 #[cfg(feature = "arbitrary")]
15154 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
15155 use arbitrary::{Arbitrary, Unstructured};
15156 let mut buf = [0u8; 1024];
15157 rng.fill_bytes(&mut buf);
15158 let mut unstructured = Unstructured::new(&buf);
15159 Self::arbitrary(&mut unstructured).unwrap_or_default()
15160 }
15161}
15162impl Default for HIGH_LATENCY_DATA {
15163 fn default() -> Self {
15164 Self::DEFAULT.clone()
15165 }
15166}
15167impl MessageData for HIGH_LATENCY_DATA {
15168 type Message = MavMessage;
15169 const ID: u32 = 234u32;
15170 const NAME: &'static str = "HIGH_LATENCY";
15171 const EXTRA_CRC: u8 = 150u8;
15172 const ENCODED_LEN: usize = 40usize;
15173 fn deser(
15174 _version: MavlinkVersion,
15175 __input: &[u8],
15176 ) -> Result<Self, ::mavlink_core::error::ParserError> {
15177 let avail_len = __input.len();
15178 let mut payload_buf = [0; Self::ENCODED_LEN];
15179 let mut buf = if avail_len < Self::ENCODED_LEN {
15180 payload_buf[0..avail_len].copy_from_slice(__input);
15181 Bytes::new(&payload_buf)
15182 } else {
15183 Bytes::new(__input)
15184 };
15185 let mut __struct = Self::default();
15186 __struct.custom_mode = buf.get_u32_le();
15187 __struct.latitude = buf.get_i32_le();
15188 __struct.longitude = buf.get_i32_le();
15189 __struct.roll = buf.get_i16_le();
15190 __struct.pitch = buf.get_i16_le();
15191 __struct.heading = buf.get_u16_le();
15192 __struct.heading_sp = buf.get_i16_le();
15193 __struct.altitude_amsl = buf.get_i16_le();
15194 __struct.altitude_sp = buf.get_i16_le();
15195 __struct.wp_distance = buf.get_u16_le();
15196 let tmp = buf.get_u8();
15197 __struct.base_mode = MavModeFlag::from_bits(tmp & MavModeFlag::all().bits()).ok_or(
15198 ::mavlink_core::error::ParserError::InvalidFlag {
15199 flag_type: "MavModeFlag",
15200 value: tmp as u32,
15201 },
15202 )?;
15203 let tmp = buf.get_u8();
15204 __struct.landed_state =
15205 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
15206 enum_type: "MavLandedState",
15207 value: tmp as u32,
15208 })?;
15209 __struct.throttle = buf.get_i8();
15210 __struct.airspeed = buf.get_u8();
15211 __struct.airspeed_sp = buf.get_u8();
15212 __struct.groundspeed = buf.get_u8();
15213 __struct.climb_rate = buf.get_i8();
15214 __struct.gps_nsat = buf.get_u8();
15215 let tmp = buf.get_u8();
15216 __struct.gps_fix_type =
15217 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
15218 enum_type: "GpsFixType",
15219 value: tmp as u32,
15220 })?;
15221 __struct.battery_remaining = buf.get_u8();
15222 __struct.temperature = buf.get_i8();
15223 __struct.temperature_air = buf.get_i8();
15224 __struct.failsafe = buf.get_u8();
15225 __struct.wp_num = buf.get_u8();
15226 Ok(__struct)
15227 }
15228 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
15229 let mut __tmp = BytesMut::new(bytes);
15230 #[allow(clippy::absurd_extreme_comparisons)]
15231 #[allow(unused_comparisons)]
15232 if __tmp.remaining() < Self::ENCODED_LEN {
15233 panic!(
15234 "buffer is too small (need {} bytes, but got {})",
15235 Self::ENCODED_LEN,
15236 __tmp.remaining(),
15237 )
15238 }
15239 __tmp.put_u32_le(self.custom_mode);
15240 __tmp.put_i32_le(self.latitude);
15241 __tmp.put_i32_le(self.longitude);
15242 __tmp.put_i16_le(self.roll);
15243 __tmp.put_i16_le(self.pitch);
15244 __tmp.put_u16_le(self.heading);
15245 __tmp.put_i16_le(self.heading_sp);
15246 __tmp.put_i16_le(self.altitude_amsl);
15247 __tmp.put_i16_le(self.altitude_sp);
15248 __tmp.put_u16_le(self.wp_distance);
15249 __tmp.put_u8(self.base_mode.bits());
15250 __tmp.put_u8(self.landed_state as u8);
15251 __tmp.put_i8(self.throttle);
15252 __tmp.put_u8(self.airspeed);
15253 __tmp.put_u8(self.airspeed_sp);
15254 __tmp.put_u8(self.groundspeed);
15255 __tmp.put_i8(self.climb_rate);
15256 __tmp.put_u8(self.gps_nsat);
15257 __tmp.put_u8(self.gps_fix_type as u8);
15258 __tmp.put_u8(self.battery_remaining);
15259 __tmp.put_i8(self.temperature);
15260 __tmp.put_i8(self.temperature_air);
15261 __tmp.put_u8(self.failsafe);
15262 __tmp.put_u8(self.wp_num);
15263 if matches!(version, MavlinkVersion::V2) {
15264 let len = __tmp.len();
15265 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
15266 } else {
15267 __tmp.len()
15268 }
15269 }
15270}
15271#[doc = "Message appropriate for high latency connections like Iridium (version 2)."]
15272#[doc = ""]
15273#[doc = "ID: 235"]
15274#[derive(Debug, Clone, PartialEq)]
15275#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
15276#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
15277pub struct HIGH_LATENCY2_DATA {
15278 #[doc = "Timestamp (milliseconds since boot or Unix epoch)"]
15279 pub timestamp: u32,
15280 #[doc = "Latitude"]
15281 pub latitude: i32,
15282 #[doc = "Longitude"]
15283 pub longitude: i32,
15284 #[doc = "A bitfield for use for autopilot-specific flags (2 byte version)."]
15285 pub custom_mode: u16,
15286 #[doc = "Altitude above mean sea level"]
15287 pub altitude: i16,
15288 #[doc = "Altitude setpoint"]
15289 pub target_altitude: i16,
15290 #[doc = "Distance to target waypoint or position"]
15291 pub target_distance: u16,
15292 #[doc = "Current waypoint number"]
15293 pub wp_num: u16,
15294 #[doc = "Bitmap of failure flags."]
15295 pub failure_flags: HlFailureFlag,
15296 #[doc = "Type of the MAV (quadrotor, helicopter, etc.)"]
15297 pub mavtype: MavType,
15298 #[doc = "Autopilot type / class. Use MAV_AUTOPILOT_INVALID for components that are not flight controllers."]
15299 pub autopilot: MavAutopilot,
15300 #[doc = "Heading"]
15301 pub heading: u8,
15302 #[doc = "Heading setpoint"]
15303 pub target_heading: u8,
15304 #[doc = "Throttle"]
15305 pub throttle: u8,
15306 #[doc = "Airspeed"]
15307 pub airspeed: u8,
15308 #[doc = "Airspeed setpoint"]
15309 pub airspeed_sp: u8,
15310 #[doc = "Groundspeed"]
15311 pub groundspeed: u8,
15312 #[doc = "Windspeed"]
15313 pub windspeed: u8,
15314 #[doc = "Wind heading"]
15315 pub wind_heading: u8,
15316 #[doc = "Maximum error horizontal position since last message"]
15317 pub eph: u8,
15318 #[doc = "Maximum error vertical position since last message"]
15319 pub epv: u8,
15320 #[doc = "Air temperature"]
15321 pub temperature_air: i8,
15322 #[doc = "Maximum climb rate magnitude since last message"]
15323 pub climb_rate: i8,
15324 #[doc = "Battery level (-1 if field not provided)."]
15325 pub battery: i8,
15326 #[doc = "Field for custom payload."]
15327 pub custom0: i8,
15328 #[doc = "Field for custom payload."]
15329 pub custom1: i8,
15330 #[doc = "Field for custom payload."]
15331 pub custom2: i8,
15332}
15333impl HIGH_LATENCY2_DATA {
15334 pub const ENCODED_LEN: usize = 42usize;
15335 pub const DEFAULT: Self = Self {
15336 timestamp: 0_u32,
15337 latitude: 0_i32,
15338 longitude: 0_i32,
15339 custom_mode: 0_u16,
15340 altitude: 0_i16,
15341 target_altitude: 0_i16,
15342 target_distance: 0_u16,
15343 wp_num: 0_u16,
15344 failure_flags: HlFailureFlag::DEFAULT,
15345 mavtype: MavType::DEFAULT,
15346 autopilot: MavAutopilot::DEFAULT,
15347 heading: 0_u8,
15348 target_heading: 0_u8,
15349 throttle: 0_u8,
15350 airspeed: 0_u8,
15351 airspeed_sp: 0_u8,
15352 groundspeed: 0_u8,
15353 windspeed: 0_u8,
15354 wind_heading: 0_u8,
15355 eph: 0_u8,
15356 epv: 0_u8,
15357 temperature_air: 0_i8,
15358 climb_rate: 0_i8,
15359 battery: 0_i8,
15360 custom0: 0_i8,
15361 custom1: 0_i8,
15362 custom2: 0_i8,
15363 };
15364 #[cfg(feature = "arbitrary")]
15365 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
15366 use arbitrary::{Arbitrary, Unstructured};
15367 let mut buf = [0u8; 1024];
15368 rng.fill_bytes(&mut buf);
15369 let mut unstructured = Unstructured::new(&buf);
15370 Self::arbitrary(&mut unstructured).unwrap_or_default()
15371 }
15372}
15373impl Default for HIGH_LATENCY2_DATA {
15374 fn default() -> Self {
15375 Self::DEFAULT.clone()
15376 }
15377}
15378impl MessageData for HIGH_LATENCY2_DATA {
15379 type Message = MavMessage;
15380 const ID: u32 = 235u32;
15381 const NAME: &'static str = "HIGH_LATENCY2";
15382 const EXTRA_CRC: u8 = 179u8;
15383 const ENCODED_LEN: usize = 42usize;
15384 fn deser(
15385 _version: MavlinkVersion,
15386 __input: &[u8],
15387 ) -> Result<Self, ::mavlink_core::error::ParserError> {
15388 let avail_len = __input.len();
15389 let mut payload_buf = [0; Self::ENCODED_LEN];
15390 let mut buf = if avail_len < Self::ENCODED_LEN {
15391 payload_buf[0..avail_len].copy_from_slice(__input);
15392 Bytes::new(&payload_buf)
15393 } else {
15394 Bytes::new(__input)
15395 };
15396 let mut __struct = Self::default();
15397 __struct.timestamp = buf.get_u32_le();
15398 __struct.latitude = buf.get_i32_le();
15399 __struct.longitude = buf.get_i32_le();
15400 __struct.custom_mode = buf.get_u16_le();
15401 __struct.altitude = buf.get_i16_le();
15402 __struct.target_altitude = buf.get_i16_le();
15403 __struct.target_distance = buf.get_u16_le();
15404 __struct.wp_num = buf.get_u16_le();
15405 let tmp = buf.get_u16_le();
15406 __struct.failure_flags = HlFailureFlag::from_bits(tmp & HlFailureFlag::all().bits())
15407 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
15408 flag_type: "HlFailureFlag",
15409 value: tmp as u32,
15410 })?;
15411 let tmp = buf.get_u8();
15412 __struct.mavtype =
15413 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
15414 enum_type: "MavType",
15415 value: tmp as u32,
15416 })?;
15417 let tmp = buf.get_u8();
15418 __struct.autopilot =
15419 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
15420 enum_type: "MavAutopilot",
15421 value: tmp as u32,
15422 })?;
15423 __struct.heading = buf.get_u8();
15424 __struct.target_heading = buf.get_u8();
15425 __struct.throttle = buf.get_u8();
15426 __struct.airspeed = buf.get_u8();
15427 __struct.airspeed_sp = buf.get_u8();
15428 __struct.groundspeed = buf.get_u8();
15429 __struct.windspeed = buf.get_u8();
15430 __struct.wind_heading = buf.get_u8();
15431 __struct.eph = buf.get_u8();
15432 __struct.epv = buf.get_u8();
15433 __struct.temperature_air = buf.get_i8();
15434 __struct.climb_rate = buf.get_i8();
15435 __struct.battery = buf.get_i8();
15436 __struct.custom0 = buf.get_i8();
15437 __struct.custom1 = buf.get_i8();
15438 __struct.custom2 = buf.get_i8();
15439 Ok(__struct)
15440 }
15441 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
15442 let mut __tmp = BytesMut::new(bytes);
15443 #[allow(clippy::absurd_extreme_comparisons)]
15444 #[allow(unused_comparisons)]
15445 if __tmp.remaining() < Self::ENCODED_LEN {
15446 panic!(
15447 "buffer is too small (need {} bytes, but got {})",
15448 Self::ENCODED_LEN,
15449 __tmp.remaining(),
15450 )
15451 }
15452 __tmp.put_u32_le(self.timestamp);
15453 __tmp.put_i32_le(self.latitude);
15454 __tmp.put_i32_le(self.longitude);
15455 __tmp.put_u16_le(self.custom_mode);
15456 __tmp.put_i16_le(self.altitude);
15457 __tmp.put_i16_le(self.target_altitude);
15458 __tmp.put_u16_le(self.target_distance);
15459 __tmp.put_u16_le(self.wp_num);
15460 __tmp.put_u16_le(self.failure_flags.bits());
15461 __tmp.put_u8(self.mavtype as u8);
15462 __tmp.put_u8(self.autopilot as u8);
15463 __tmp.put_u8(self.heading);
15464 __tmp.put_u8(self.target_heading);
15465 __tmp.put_u8(self.throttle);
15466 __tmp.put_u8(self.airspeed);
15467 __tmp.put_u8(self.airspeed_sp);
15468 __tmp.put_u8(self.groundspeed);
15469 __tmp.put_u8(self.windspeed);
15470 __tmp.put_u8(self.wind_heading);
15471 __tmp.put_u8(self.eph);
15472 __tmp.put_u8(self.epv);
15473 __tmp.put_i8(self.temperature_air);
15474 __tmp.put_i8(self.climb_rate);
15475 __tmp.put_i8(self.battery);
15476 __tmp.put_i8(self.custom0);
15477 __tmp.put_i8(self.custom1);
15478 __tmp.put_i8(self.custom2);
15479 if matches!(version, MavlinkVersion::V2) {
15480 let len = __tmp.len();
15481 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
15482 } else {
15483 __tmp.len()
15484 }
15485 }
15486}
15487#[doc = "Sent from autopilot to simulation. Hardware in the loop control outputs. Alternative to HIL_CONTROLS."]
15488#[doc = ""]
15489#[doc = "ID: 93"]
15490#[derive(Debug, Clone, PartialEq)]
15491#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
15492#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
15493pub struct HIL_ACTUATOR_CONTROLS_DATA {
15494 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
15495 pub time_usec: u64,
15496 #[doc = "Flags bitmask."]
15497 pub flags: HilActuatorControlsFlags,
15498 #[doc = "Control outputs -1 .. 1. Channel assignment depends on the simulated hardware."]
15499 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
15500 pub controls: [f32; 16],
15501 #[doc = "System mode. Includes arming state."]
15502 pub mode: MavModeFlag,
15503}
15504impl HIL_ACTUATOR_CONTROLS_DATA {
15505 pub const ENCODED_LEN: usize = 81usize;
15506 pub const DEFAULT: Self = Self {
15507 time_usec: 0_u64,
15508 flags: HilActuatorControlsFlags::DEFAULT,
15509 controls: [0.0_f32; 16usize],
15510 mode: MavModeFlag::DEFAULT,
15511 };
15512 #[cfg(feature = "arbitrary")]
15513 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
15514 use arbitrary::{Arbitrary, Unstructured};
15515 let mut buf = [0u8; 1024];
15516 rng.fill_bytes(&mut buf);
15517 let mut unstructured = Unstructured::new(&buf);
15518 Self::arbitrary(&mut unstructured).unwrap_or_default()
15519 }
15520}
15521impl Default for HIL_ACTUATOR_CONTROLS_DATA {
15522 fn default() -> Self {
15523 Self::DEFAULT.clone()
15524 }
15525}
15526impl MessageData for HIL_ACTUATOR_CONTROLS_DATA {
15527 type Message = MavMessage;
15528 const ID: u32 = 93u32;
15529 const NAME: &'static str = "HIL_ACTUATOR_CONTROLS";
15530 const EXTRA_CRC: u8 = 47u8;
15531 const ENCODED_LEN: usize = 81usize;
15532 fn deser(
15533 _version: MavlinkVersion,
15534 __input: &[u8],
15535 ) -> Result<Self, ::mavlink_core::error::ParserError> {
15536 let avail_len = __input.len();
15537 let mut payload_buf = [0; Self::ENCODED_LEN];
15538 let mut buf = if avail_len < Self::ENCODED_LEN {
15539 payload_buf[0..avail_len].copy_from_slice(__input);
15540 Bytes::new(&payload_buf)
15541 } else {
15542 Bytes::new(__input)
15543 };
15544 let mut __struct = Self::default();
15545 __struct.time_usec = buf.get_u64_le();
15546 let tmp = buf.get_u64_le();
15547 __struct.flags =
15548 HilActuatorControlsFlags::from_bits(tmp & HilActuatorControlsFlags::all().bits())
15549 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
15550 flag_type: "HilActuatorControlsFlags",
15551 value: tmp as u32,
15552 })?;
15553 for v in &mut __struct.controls {
15554 let val = buf.get_f32_le();
15555 *v = val;
15556 }
15557 let tmp = buf.get_u8();
15558 __struct.mode = MavModeFlag::from_bits(tmp & MavModeFlag::all().bits()).ok_or(
15559 ::mavlink_core::error::ParserError::InvalidFlag {
15560 flag_type: "MavModeFlag",
15561 value: tmp as u32,
15562 },
15563 )?;
15564 Ok(__struct)
15565 }
15566 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
15567 let mut __tmp = BytesMut::new(bytes);
15568 #[allow(clippy::absurd_extreme_comparisons)]
15569 #[allow(unused_comparisons)]
15570 if __tmp.remaining() < Self::ENCODED_LEN {
15571 panic!(
15572 "buffer is too small (need {} bytes, but got {})",
15573 Self::ENCODED_LEN,
15574 __tmp.remaining(),
15575 )
15576 }
15577 __tmp.put_u64_le(self.time_usec);
15578 __tmp.put_u64_le(self.flags.bits());
15579 for val in &self.controls {
15580 __tmp.put_f32_le(*val);
15581 }
15582 __tmp.put_u8(self.mode.bits());
15583 if matches!(version, MavlinkVersion::V2) {
15584 let len = __tmp.len();
15585 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
15586 } else {
15587 __tmp.len()
15588 }
15589 }
15590}
15591#[doc = "Sent from autopilot to simulation. Hardware in the loop control outputs. Alternative to HIL_ACTUATOR_CONTROLS."]
15592#[doc = ""]
15593#[doc = "ID: 91"]
15594#[derive(Debug, Clone, PartialEq)]
15595#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
15596#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
15597pub struct HIL_CONTROLS_DATA {
15598 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
15599 pub time_usec: u64,
15600 #[doc = "Control output -1 .. 1"]
15601 pub roll_ailerons: f32,
15602 #[doc = "Control output -1 .. 1"]
15603 pub pitch_elevator: f32,
15604 #[doc = "Control output -1 .. 1"]
15605 pub yaw_rudder: f32,
15606 #[doc = "Throttle 0 .. 1"]
15607 pub throttle: f32,
15608 #[doc = "Aux 1, -1 .. 1"]
15609 pub aux1: f32,
15610 #[doc = "Aux 2, -1 .. 1"]
15611 pub aux2: f32,
15612 #[doc = "Aux 3, -1 .. 1"]
15613 pub aux3: f32,
15614 #[doc = "Aux 4, -1 .. 1"]
15615 pub aux4: f32,
15616 #[doc = "System mode."]
15617 pub mode: MavMode,
15618 #[doc = "Navigation mode (MAV_NAV_MODE)"]
15619 pub nav_mode: u8,
15620}
15621impl HIL_CONTROLS_DATA {
15622 pub const ENCODED_LEN: usize = 42usize;
15623 pub const DEFAULT: Self = Self {
15624 time_usec: 0_u64,
15625 roll_ailerons: 0.0_f32,
15626 pitch_elevator: 0.0_f32,
15627 yaw_rudder: 0.0_f32,
15628 throttle: 0.0_f32,
15629 aux1: 0.0_f32,
15630 aux2: 0.0_f32,
15631 aux3: 0.0_f32,
15632 aux4: 0.0_f32,
15633 mode: MavMode::DEFAULT,
15634 nav_mode: 0_u8,
15635 };
15636 #[cfg(feature = "arbitrary")]
15637 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
15638 use arbitrary::{Arbitrary, Unstructured};
15639 let mut buf = [0u8; 1024];
15640 rng.fill_bytes(&mut buf);
15641 let mut unstructured = Unstructured::new(&buf);
15642 Self::arbitrary(&mut unstructured).unwrap_or_default()
15643 }
15644}
15645impl Default for HIL_CONTROLS_DATA {
15646 fn default() -> Self {
15647 Self::DEFAULT.clone()
15648 }
15649}
15650impl MessageData for HIL_CONTROLS_DATA {
15651 type Message = MavMessage;
15652 const ID: u32 = 91u32;
15653 const NAME: &'static str = "HIL_CONTROLS";
15654 const EXTRA_CRC: u8 = 63u8;
15655 const ENCODED_LEN: usize = 42usize;
15656 fn deser(
15657 _version: MavlinkVersion,
15658 __input: &[u8],
15659 ) -> Result<Self, ::mavlink_core::error::ParserError> {
15660 let avail_len = __input.len();
15661 let mut payload_buf = [0; Self::ENCODED_LEN];
15662 let mut buf = if avail_len < Self::ENCODED_LEN {
15663 payload_buf[0..avail_len].copy_from_slice(__input);
15664 Bytes::new(&payload_buf)
15665 } else {
15666 Bytes::new(__input)
15667 };
15668 let mut __struct = Self::default();
15669 __struct.time_usec = buf.get_u64_le();
15670 __struct.roll_ailerons = buf.get_f32_le();
15671 __struct.pitch_elevator = buf.get_f32_le();
15672 __struct.yaw_rudder = buf.get_f32_le();
15673 __struct.throttle = buf.get_f32_le();
15674 __struct.aux1 = buf.get_f32_le();
15675 __struct.aux2 = buf.get_f32_le();
15676 __struct.aux3 = buf.get_f32_le();
15677 __struct.aux4 = buf.get_f32_le();
15678 let tmp = buf.get_u8();
15679 __struct.mode =
15680 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
15681 enum_type: "MavMode",
15682 value: tmp as u32,
15683 })?;
15684 __struct.nav_mode = buf.get_u8();
15685 Ok(__struct)
15686 }
15687 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
15688 let mut __tmp = BytesMut::new(bytes);
15689 #[allow(clippy::absurd_extreme_comparisons)]
15690 #[allow(unused_comparisons)]
15691 if __tmp.remaining() < Self::ENCODED_LEN {
15692 panic!(
15693 "buffer is too small (need {} bytes, but got {})",
15694 Self::ENCODED_LEN,
15695 __tmp.remaining(),
15696 )
15697 }
15698 __tmp.put_u64_le(self.time_usec);
15699 __tmp.put_f32_le(self.roll_ailerons);
15700 __tmp.put_f32_le(self.pitch_elevator);
15701 __tmp.put_f32_le(self.yaw_rudder);
15702 __tmp.put_f32_le(self.throttle);
15703 __tmp.put_f32_le(self.aux1);
15704 __tmp.put_f32_le(self.aux2);
15705 __tmp.put_f32_le(self.aux3);
15706 __tmp.put_f32_le(self.aux4);
15707 __tmp.put_u8(self.mode as u8);
15708 __tmp.put_u8(self.nav_mode);
15709 if matches!(version, MavlinkVersion::V2) {
15710 let len = __tmp.len();
15711 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
15712 } else {
15713 __tmp.len()
15714 }
15715 }
15716}
15717#[doc = "The global position, as returned by the Global Positioning System (GPS). This is NOT the global position estimate of the system, but rather a RAW sensor value. See message GLOBAL_POSITION_INT for the global position estimate."]
15718#[doc = ""]
15719#[doc = "ID: 113"]
15720#[derive(Debug, Clone, PartialEq)]
15721#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
15722#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
15723pub struct HIL_GPS_DATA {
15724 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
15725 pub time_usec: u64,
15726 #[doc = "Latitude (WGS84)"]
15727 pub lat: i32,
15728 #[doc = "Longitude (WGS84)"]
15729 pub lon: i32,
15730 #[doc = "Altitude (MSL). Positive for up."]
15731 pub alt: i32,
15732 #[doc = "GPS HDOP horizontal dilution of position (unitless * 100). If unknown, set to: UINT16_MAX"]
15733 pub eph: u16,
15734 #[doc = "GPS VDOP vertical dilution of position (unitless * 100). If unknown, set to: UINT16_MAX"]
15735 pub epv: u16,
15736 #[doc = "GPS ground speed. If unknown, set to: UINT16_MAX"]
15737 pub vel: u16,
15738 #[doc = "GPS velocity in north direction in earth-fixed NED frame"]
15739 pub vn: i16,
15740 #[doc = "GPS velocity in east direction in earth-fixed NED frame"]
15741 pub ve: i16,
15742 #[doc = "GPS velocity in down direction in earth-fixed NED frame"]
15743 pub vd: i16,
15744 #[doc = "Course over ground (NOT heading, but direction of movement), 0.0..359.99 degrees. If unknown, set to: UINT16_MAX"]
15745 pub cog: u16,
15746 #[doc = "0-1: no fix, 2: 2D fix, 3: 3D fix. Some applications will not use the value of this field unless it is at least two, so always correctly fill in the fix."]
15747 pub fix_type: u8,
15748 #[doc = "Number of satellites visible. If unknown, set to UINT8_MAX"]
15749 pub satellites_visible: u8,
15750 #[doc = "GPS ID (zero indexed). Used for multiple GPS inputs"]
15751 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
15752 pub id: u8,
15753 #[doc = "Yaw of vehicle relative to Earth's North, zero means not available, use 36000 for north"]
15754 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
15755 pub yaw: u16,
15756}
15757impl HIL_GPS_DATA {
15758 pub const ENCODED_LEN: usize = 39usize;
15759 pub const DEFAULT: Self = Self {
15760 time_usec: 0_u64,
15761 lat: 0_i32,
15762 lon: 0_i32,
15763 alt: 0_i32,
15764 eph: 0_u16,
15765 epv: 0_u16,
15766 vel: 0_u16,
15767 vn: 0_i16,
15768 ve: 0_i16,
15769 vd: 0_i16,
15770 cog: 0_u16,
15771 fix_type: 0_u8,
15772 satellites_visible: 0_u8,
15773 id: 0_u8,
15774 yaw: 0_u16,
15775 };
15776 #[cfg(feature = "arbitrary")]
15777 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
15778 use arbitrary::{Arbitrary, Unstructured};
15779 let mut buf = [0u8; 1024];
15780 rng.fill_bytes(&mut buf);
15781 let mut unstructured = Unstructured::new(&buf);
15782 Self::arbitrary(&mut unstructured).unwrap_or_default()
15783 }
15784}
15785impl Default for HIL_GPS_DATA {
15786 fn default() -> Self {
15787 Self::DEFAULT.clone()
15788 }
15789}
15790impl MessageData for HIL_GPS_DATA {
15791 type Message = MavMessage;
15792 const ID: u32 = 113u32;
15793 const NAME: &'static str = "HIL_GPS";
15794 const EXTRA_CRC: u8 = 124u8;
15795 const ENCODED_LEN: usize = 39usize;
15796 fn deser(
15797 _version: MavlinkVersion,
15798 __input: &[u8],
15799 ) -> Result<Self, ::mavlink_core::error::ParserError> {
15800 let avail_len = __input.len();
15801 let mut payload_buf = [0; Self::ENCODED_LEN];
15802 let mut buf = if avail_len < Self::ENCODED_LEN {
15803 payload_buf[0..avail_len].copy_from_slice(__input);
15804 Bytes::new(&payload_buf)
15805 } else {
15806 Bytes::new(__input)
15807 };
15808 let mut __struct = Self::default();
15809 __struct.time_usec = buf.get_u64_le();
15810 __struct.lat = buf.get_i32_le();
15811 __struct.lon = buf.get_i32_le();
15812 __struct.alt = buf.get_i32_le();
15813 __struct.eph = buf.get_u16_le();
15814 __struct.epv = buf.get_u16_le();
15815 __struct.vel = buf.get_u16_le();
15816 __struct.vn = buf.get_i16_le();
15817 __struct.ve = buf.get_i16_le();
15818 __struct.vd = buf.get_i16_le();
15819 __struct.cog = buf.get_u16_le();
15820 __struct.fix_type = buf.get_u8();
15821 __struct.satellites_visible = buf.get_u8();
15822 __struct.id = buf.get_u8();
15823 __struct.yaw = buf.get_u16_le();
15824 Ok(__struct)
15825 }
15826 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
15827 let mut __tmp = BytesMut::new(bytes);
15828 #[allow(clippy::absurd_extreme_comparisons)]
15829 #[allow(unused_comparisons)]
15830 if __tmp.remaining() < Self::ENCODED_LEN {
15831 panic!(
15832 "buffer is too small (need {} bytes, but got {})",
15833 Self::ENCODED_LEN,
15834 __tmp.remaining(),
15835 )
15836 }
15837 __tmp.put_u64_le(self.time_usec);
15838 __tmp.put_i32_le(self.lat);
15839 __tmp.put_i32_le(self.lon);
15840 __tmp.put_i32_le(self.alt);
15841 __tmp.put_u16_le(self.eph);
15842 __tmp.put_u16_le(self.epv);
15843 __tmp.put_u16_le(self.vel);
15844 __tmp.put_i16_le(self.vn);
15845 __tmp.put_i16_le(self.ve);
15846 __tmp.put_i16_le(self.vd);
15847 __tmp.put_u16_le(self.cog);
15848 __tmp.put_u8(self.fix_type);
15849 __tmp.put_u8(self.satellites_visible);
15850 if matches!(version, MavlinkVersion::V2) {
15851 __tmp.put_u8(self.id);
15852 __tmp.put_u16_le(self.yaw);
15853 let len = __tmp.len();
15854 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
15855 } else {
15856 __tmp.len()
15857 }
15858 }
15859}
15860#[doc = "Simulated optical flow from a flow sensor (e.g. PX4FLOW or optical mouse sensor)."]
15861#[doc = ""]
15862#[doc = "ID: 114"]
15863#[derive(Debug, Clone, PartialEq)]
15864#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
15865#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
15866pub struct HIL_OPTICAL_FLOW_DATA {
15867 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
15868 pub time_usec: u64,
15869 #[doc = "Integration time. Divide integrated_x and integrated_y by the integration time to obtain average flow. The integration time also indicates the."]
15870 pub integration_time_us: u32,
15871 #[doc = "Flow in radians around X axis (Sensor RH rotation about the X axis induces a positive flow. Sensor linear motion along the positive Y axis induces a negative flow.)"]
15872 pub integrated_x: f32,
15873 #[doc = "Flow in radians around Y axis (Sensor RH rotation about the Y axis induces a positive flow. Sensor linear motion along the positive X axis induces a positive flow.)"]
15874 pub integrated_y: f32,
15875 #[doc = "RH rotation around X axis"]
15876 pub integrated_xgyro: f32,
15877 #[doc = "RH rotation around Y axis"]
15878 pub integrated_ygyro: f32,
15879 #[doc = "RH rotation around Z axis"]
15880 pub integrated_zgyro: f32,
15881 #[doc = "Time since the distance was sampled."]
15882 pub time_delta_distance_us: u32,
15883 #[doc = "Distance to the center of the flow field. Positive value (including zero): distance known. Negative value: Unknown distance."]
15884 pub distance: f32,
15885 #[doc = "Temperature"]
15886 pub temperature: i16,
15887 #[doc = "Sensor ID"]
15888 pub sensor_id: u8,
15889 #[doc = "Optical flow quality / confidence. 0: no valid flow, 255: maximum quality"]
15890 pub quality: u8,
15891}
15892impl HIL_OPTICAL_FLOW_DATA {
15893 pub const ENCODED_LEN: usize = 44usize;
15894 pub const DEFAULT: Self = Self {
15895 time_usec: 0_u64,
15896 integration_time_us: 0_u32,
15897 integrated_x: 0.0_f32,
15898 integrated_y: 0.0_f32,
15899 integrated_xgyro: 0.0_f32,
15900 integrated_ygyro: 0.0_f32,
15901 integrated_zgyro: 0.0_f32,
15902 time_delta_distance_us: 0_u32,
15903 distance: 0.0_f32,
15904 temperature: 0_i16,
15905 sensor_id: 0_u8,
15906 quality: 0_u8,
15907 };
15908 #[cfg(feature = "arbitrary")]
15909 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
15910 use arbitrary::{Arbitrary, Unstructured};
15911 let mut buf = [0u8; 1024];
15912 rng.fill_bytes(&mut buf);
15913 let mut unstructured = Unstructured::new(&buf);
15914 Self::arbitrary(&mut unstructured).unwrap_or_default()
15915 }
15916}
15917impl Default for HIL_OPTICAL_FLOW_DATA {
15918 fn default() -> Self {
15919 Self::DEFAULT.clone()
15920 }
15921}
15922impl MessageData for HIL_OPTICAL_FLOW_DATA {
15923 type Message = MavMessage;
15924 const ID: u32 = 114u32;
15925 const NAME: &'static str = "HIL_OPTICAL_FLOW";
15926 const EXTRA_CRC: u8 = 237u8;
15927 const ENCODED_LEN: usize = 44usize;
15928 fn deser(
15929 _version: MavlinkVersion,
15930 __input: &[u8],
15931 ) -> Result<Self, ::mavlink_core::error::ParserError> {
15932 let avail_len = __input.len();
15933 let mut payload_buf = [0; Self::ENCODED_LEN];
15934 let mut buf = if avail_len < Self::ENCODED_LEN {
15935 payload_buf[0..avail_len].copy_from_slice(__input);
15936 Bytes::new(&payload_buf)
15937 } else {
15938 Bytes::new(__input)
15939 };
15940 let mut __struct = Self::default();
15941 __struct.time_usec = buf.get_u64_le();
15942 __struct.integration_time_us = buf.get_u32_le();
15943 __struct.integrated_x = buf.get_f32_le();
15944 __struct.integrated_y = buf.get_f32_le();
15945 __struct.integrated_xgyro = buf.get_f32_le();
15946 __struct.integrated_ygyro = buf.get_f32_le();
15947 __struct.integrated_zgyro = buf.get_f32_le();
15948 __struct.time_delta_distance_us = buf.get_u32_le();
15949 __struct.distance = buf.get_f32_le();
15950 __struct.temperature = buf.get_i16_le();
15951 __struct.sensor_id = buf.get_u8();
15952 __struct.quality = buf.get_u8();
15953 Ok(__struct)
15954 }
15955 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
15956 let mut __tmp = BytesMut::new(bytes);
15957 #[allow(clippy::absurd_extreme_comparisons)]
15958 #[allow(unused_comparisons)]
15959 if __tmp.remaining() < Self::ENCODED_LEN {
15960 panic!(
15961 "buffer is too small (need {} bytes, but got {})",
15962 Self::ENCODED_LEN,
15963 __tmp.remaining(),
15964 )
15965 }
15966 __tmp.put_u64_le(self.time_usec);
15967 __tmp.put_u32_le(self.integration_time_us);
15968 __tmp.put_f32_le(self.integrated_x);
15969 __tmp.put_f32_le(self.integrated_y);
15970 __tmp.put_f32_le(self.integrated_xgyro);
15971 __tmp.put_f32_le(self.integrated_ygyro);
15972 __tmp.put_f32_le(self.integrated_zgyro);
15973 __tmp.put_u32_le(self.time_delta_distance_us);
15974 __tmp.put_f32_le(self.distance);
15975 __tmp.put_i16_le(self.temperature);
15976 __tmp.put_u8(self.sensor_id);
15977 __tmp.put_u8(self.quality);
15978 if matches!(version, MavlinkVersion::V2) {
15979 let len = __tmp.len();
15980 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
15981 } else {
15982 __tmp.len()
15983 }
15984 }
15985}
15986#[doc = "Sent from simulation to autopilot. The RAW values of the RC channels received. The standard PPM modulation is as follows: 1000 microseconds: 0%, 2000 microseconds: 100%. Individual receivers/transmitters might violate this specification."]
15987#[doc = ""]
15988#[doc = "ID: 92"]
15989#[derive(Debug, Clone, PartialEq)]
15990#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
15991#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
15992pub struct HIL_RC_INPUTS_RAW_DATA {
15993 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
15994 pub time_usec: u64,
15995 #[doc = "RC channel 1 value"]
15996 pub chan1_raw: u16,
15997 #[doc = "RC channel 2 value"]
15998 pub chan2_raw: u16,
15999 #[doc = "RC channel 3 value"]
16000 pub chan3_raw: u16,
16001 #[doc = "RC channel 4 value"]
16002 pub chan4_raw: u16,
16003 #[doc = "RC channel 5 value"]
16004 pub chan5_raw: u16,
16005 #[doc = "RC channel 6 value"]
16006 pub chan6_raw: u16,
16007 #[doc = "RC channel 7 value"]
16008 pub chan7_raw: u16,
16009 #[doc = "RC channel 8 value"]
16010 pub chan8_raw: u16,
16011 #[doc = "RC channel 9 value"]
16012 pub chan9_raw: u16,
16013 #[doc = "RC channel 10 value"]
16014 pub chan10_raw: u16,
16015 #[doc = "RC channel 11 value"]
16016 pub chan11_raw: u16,
16017 #[doc = "RC channel 12 value"]
16018 pub chan12_raw: u16,
16019 #[doc = "Receive signal strength indicator in device-dependent units/scale. Values: [0-254], UINT8_MAX: invalid/unknown."]
16020 pub rssi: u8,
16021}
16022impl HIL_RC_INPUTS_RAW_DATA {
16023 pub const ENCODED_LEN: usize = 33usize;
16024 pub const DEFAULT: Self = Self {
16025 time_usec: 0_u64,
16026 chan1_raw: 0_u16,
16027 chan2_raw: 0_u16,
16028 chan3_raw: 0_u16,
16029 chan4_raw: 0_u16,
16030 chan5_raw: 0_u16,
16031 chan6_raw: 0_u16,
16032 chan7_raw: 0_u16,
16033 chan8_raw: 0_u16,
16034 chan9_raw: 0_u16,
16035 chan10_raw: 0_u16,
16036 chan11_raw: 0_u16,
16037 chan12_raw: 0_u16,
16038 rssi: 0_u8,
16039 };
16040 #[cfg(feature = "arbitrary")]
16041 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
16042 use arbitrary::{Arbitrary, Unstructured};
16043 let mut buf = [0u8; 1024];
16044 rng.fill_bytes(&mut buf);
16045 let mut unstructured = Unstructured::new(&buf);
16046 Self::arbitrary(&mut unstructured).unwrap_or_default()
16047 }
16048}
16049impl Default for HIL_RC_INPUTS_RAW_DATA {
16050 fn default() -> Self {
16051 Self::DEFAULT.clone()
16052 }
16053}
16054impl MessageData for HIL_RC_INPUTS_RAW_DATA {
16055 type Message = MavMessage;
16056 const ID: u32 = 92u32;
16057 const NAME: &'static str = "HIL_RC_INPUTS_RAW";
16058 const EXTRA_CRC: u8 = 54u8;
16059 const ENCODED_LEN: usize = 33usize;
16060 fn deser(
16061 _version: MavlinkVersion,
16062 __input: &[u8],
16063 ) -> Result<Self, ::mavlink_core::error::ParserError> {
16064 let avail_len = __input.len();
16065 let mut payload_buf = [0; Self::ENCODED_LEN];
16066 let mut buf = if avail_len < Self::ENCODED_LEN {
16067 payload_buf[0..avail_len].copy_from_slice(__input);
16068 Bytes::new(&payload_buf)
16069 } else {
16070 Bytes::new(__input)
16071 };
16072 let mut __struct = Self::default();
16073 __struct.time_usec = buf.get_u64_le();
16074 __struct.chan1_raw = buf.get_u16_le();
16075 __struct.chan2_raw = buf.get_u16_le();
16076 __struct.chan3_raw = buf.get_u16_le();
16077 __struct.chan4_raw = buf.get_u16_le();
16078 __struct.chan5_raw = buf.get_u16_le();
16079 __struct.chan6_raw = buf.get_u16_le();
16080 __struct.chan7_raw = buf.get_u16_le();
16081 __struct.chan8_raw = buf.get_u16_le();
16082 __struct.chan9_raw = buf.get_u16_le();
16083 __struct.chan10_raw = buf.get_u16_le();
16084 __struct.chan11_raw = buf.get_u16_le();
16085 __struct.chan12_raw = buf.get_u16_le();
16086 __struct.rssi = buf.get_u8();
16087 Ok(__struct)
16088 }
16089 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
16090 let mut __tmp = BytesMut::new(bytes);
16091 #[allow(clippy::absurd_extreme_comparisons)]
16092 #[allow(unused_comparisons)]
16093 if __tmp.remaining() < Self::ENCODED_LEN {
16094 panic!(
16095 "buffer is too small (need {} bytes, but got {})",
16096 Self::ENCODED_LEN,
16097 __tmp.remaining(),
16098 )
16099 }
16100 __tmp.put_u64_le(self.time_usec);
16101 __tmp.put_u16_le(self.chan1_raw);
16102 __tmp.put_u16_le(self.chan2_raw);
16103 __tmp.put_u16_le(self.chan3_raw);
16104 __tmp.put_u16_le(self.chan4_raw);
16105 __tmp.put_u16_le(self.chan5_raw);
16106 __tmp.put_u16_le(self.chan6_raw);
16107 __tmp.put_u16_le(self.chan7_raw);
16108 __tmp.put_u16_le(self.chan8_raw);
16109 __tmp.put_u16_le(self.chan9_raw);
16110 __tmp.put_u16_le(self.chan10_raw);
16111 __tmp.put_u16_le(self.chan11_raw);
16112 __tmp.put_u16_le(self.chan12_raw);
16113 __tmp.put_u8(self.rssi);
16114 if matches!(version, MavlinkVersion::V2) {
16115 let len = __tmp.len();
16116 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
16117 } else {
16118 __tmp.len()
16119 }
16120 }
16121}
16122#[doc = "The IMU readings in SI units in NED body frame."]
16123#[doc = ""]
16124#[doc = "ID: 107"]
16125#[derive(Debug, Clone, PartialEq)]
16126#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
16127#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
16128pub struct HIL_SENSOR_DATA {
16129 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
16130 pub time_usec: u64,
16131 #[doc = "X acceleration"]
16132 pub xacc: f32,
16133 #[doc = "Y acceleration"]
16134 pub yacc: f32,
16135 #[doc = "Z acceleration"]
16136 pub zacc: f32,
16137 #[doc = "Angular speed around X axis in body frame"]
16138 pub xgyro: f32,
16139 #[doc = "Angular speed around Y axis in body frame"]
16140 pub ygyro: f32,
16141 #[doc = "Angular speed around Z axis in body frame"]
16142 pub zgyro: f32,
16143 #[doc = "X Magnetic field"]
16144 pub xmag: f32,
16145 #[doc = "Y Magnetic field"]
16146 pub ymag: f32,
16147 #[doc = "Z Magnetic field"]
16148 pub zmag: f32,
16149 #[doc = "Absolute pressure"]
16150 pub abs_pressure: f32,
16151 #[doc = "Differential pressure (airspeed)"]
16152 pub diff_pressure: f32,
16153 #[doc = "Altitude calculated from pressure"]
16154 pub pressure_alt: f32,
16155 #[doc = "Temperature"]
16156 pub temperature: f32,
16157 #[doc = "Bitmap for fields that have updated since last message"]
16158 pub fields_updated: HilSensorUpdatedFlags,
16159 #[doc = "Sensor ID (zero indexed). Used for multiple sensor inputs"]
16160 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
16161 pub id: u8,
16162}
16163impl HIL_SENSOR_DATA {
16164 pub const ENCODED_LEN: usize = 65usize;
16165 pub const DEFAULT: Self = Self {
16166 time_usec: 0_u64,
16167 xacc: 0.0_f32,
16168 yacc: 0.0_f32,
16169 zacc: 0.0_f32,
16170 xgyro: 0.0_f32,
16171 ygyro: 0.0_f32,
16172 zgyro: 0.0_f32,
16173 xmag: 0.0_f32,
16174 ymag: 0.0_f32,
16175 zmag: 0.0_f32,
16176 abs_pressure: 0.0_f32,
16177 diff_pressure: 0.0_f32,
16178 pressure_alt: 0.0_f32,
16179 temperature: 0.0_f32,
16180 fields_updated: HilSensorUpdatedFlags::DEFAULT,
16181 id: 0_u8,
16182 };
16183 #[cfg(feature = "arbitrary")]
16184 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
16185 use arbitrary::{Arbitrary, Unstructured};
16186 let mut buf = [0u8; 1024];
16187 rng.fill_bytes(&mut buf);
16188 let mut unstructured = Unstructured::new(&buf);
16189 Self::arbitrary(&mut unstructured).unwrap_or_default()
16190 }
16191}
16192impl Default for HIL_SENSOR_DATA {
16193 fn default() -> Self {
16194 Self::DEFAULT.clone()
16195 }
16196}
16197impl MessageData for HIL_SENSOR_DATA {
16198 type Message = MavMessage;
16199 const ID: u32 = 107u32;
16200 const NAME: &'static str = "HIL_SENSOR";
16201 const EXTRA_CRC: u8 = 108u8;
16202 const ENCODED_LEN: usize = 65usize;
16203 fn deser(
16204 _version: MavlinkVersion,
16205 __input: &[u8],
16206 ) -> Result<Self, ::mavlink_core::error::ParserError> {
16207 let avail_len = __input.len();
16208 let mut payload_buf = [0; Self::ENCODED_LEN];
16209 let mut buf = if avail_len < Self::ENCODED_LEN {
16210 payload_buf[0..avail_len].copy_from_slice(__input);
16211 Bytes::new(&payload_buf)
16212 } else {
16213 Bytes::new(__input)
16214 };
16215 let mut __struct = Self::default();
16216 __struct.time_usec = buf.get_u64_le();
16217 __struct.xacc = buf.get_f32_le();
16218 __struct.yacc = buf.get_f32_le();
16219 __struct.zacc = buf.get_f32_le();
16220 __struct.xgyro = buf.get_f32_le();
16221 __struct.ygyro = buf.get_f32_le();
16222 __struct.zgyro = buf.get_f32_le();
16223 __struct.xmag = buf.get_f32_le();
16224 __struct.ymag = buf.get_f32_le();
16225 __struct.zmag = buf.get_f32_le();
16226 __struct.abs_pressure = buf.get_f32_le();
16227 __struct.diff_pressure = buf.get_f32_le();
16228 __struct.pressure_alt = buf.get_f32_le();
16229 __struct.temperature = buf.get_f32_le();
16230 let tmp = buf.get_u32_le();
16231 __struct.fields_updated = HilSensorUpdatedFlags::from_bits(
16232 tmp & HilSensorUpdatedFlags::all().bits(),
16233 )
16234 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
16235 flag_type: "HilSensorUpdatedFlags",
16236 value: tmp as u32,
16237 })?;
16238 __struct.id = buf.get_u8();
16239 Ok(__struct)
16240 }
16241 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
16242 let mut __tmp = BytesMut::new(bytes);
16243 #[allow(clippy::absurd_extreme_comparisons)]
16244 #[allow(unused_comparisons)]
16245 if __tmp.remaining() < Self::ENCODED_LEN {
16246 panic!(
16247 "buffer is too small (need {} bytes, but got {})",
16248 Self::ENCODED_LEN,
16249 __tmp.remaining(),
16250 )
16251 }
16252 __tmp.put_u64_le(self.time_usec);
16253 __tmp.put_f32_le(self.xacc);
16254 __tmp.put_f32_le(self.yacc);
16255 __tmp.put_f32_le(self.zacc);
16256 __tmp.put_f32_le(self.xgyro);
16257 __tmp.put_f32_le(self.ygyro);
16258 __tmp.put_f32_le(self.zgyro);
16259 __tmp.put_f32_le(self.xmag);
16260 __tmp.put_f32_le(self.ymag);
16261 __tmp.put_f32_le(self.zmag);
16262 __tmp.put_f32_le(self.abs_pressure);
16263 __tmp.put_f32_le(self.diff_pressure);
16264 __tmp.put_f32_le(self.pressure_alt);
16265 __tmp.put_f32_le(self.temperature);
16266 __tmp.put_u32_le(self.fields_updated.bits());
16267 if matches!(version, MavlinkVersion::V2) {
16268 __tmp.put_u8(self.id);
16269 let len = __tmp.len();
16270 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
16271 } else {
16272 __tmp.len()
16273 }
16274 }
16275}
16276#[deprecated = "Suffers from missing airspeed fields and singularities due to Euler angles. See `HIL_STATE_QUATERNION` (Deprecated since 2013-07)"]
16277#[doc = "Sent from simulation to autopilot. This packet is useful for high throughput applications such as hardware in the loop simulations."]
16278#[doc = ""]
16279#[doc = "ID: 90"]
16280#[derive(Debug, Clone, PartialEq)]
16281#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
16282#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
16283pub struct HIL_STATE_DATA {
16284 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
16285 pub time_usec: u64,
16286 #[doc = "Roll angle"]
16287 pub roll: f32,
16288 #[doc = "Pitch angle"]
16289 pub pitch: f32,
16290 #[doc = "Yaw angle"]
16291 pub yaw: f32,
16292 #[doc = "Body frame roll / phi angular speed"]
16293 pub rollspeed: f32,
16294 #[doc = "Body frame pitch / theta angular speed"]
16295 pub pitchspeed: f32,
16296 #[doc = "Body frame yaw / psi angular speed"]
16297 pub yawspeed: f32,
16298 #[doc = "Latitude"]
16299 pub lat: i32,
16300 #[doc = "Longitude"]
16301 pub lon: i32,
16302 #[doc = "Altitude"]
16303 pub alt: i32,
16304 #[doc = "Ground X Speed (Latitude)"]
16305 pub vx: i16,
16306 #[doc = "Ground Y Speed (Longitude)"]
16307 pub vy: i16,
16308 #[doc = "Ground Z Speed (Altitude)"]
16309 pub vz: i16,
16310 #[doc = "X acceleration"]
16311 pub xacc: i16,
16312 #[doc = "Y acceleration"]
16313 pub yacc: i16,
16314 #[doc = "Z acceleration"]
16315 pub zacc: i16,
16316}
16317impl HIL_STATE_DATA {
16318 pub const ENCODED_LEN: usize = 56usize;
16319 pub const DEFAULT: Self = Self {
16320 time_usec: 0_u64,
16321 roll: 0.0_f32,
16322 pitch: 0.0_f32,
16323 yaw: 0.0_f32,
16324 rollspeed: 0.0_f32,
16325 pitchspeed: 0.0_f32,
16326 yawspeed: 0.0_f32,
16327 lat: 0_i32,
16328 lon: 0_i32,
16329 alt: 0_i32,
16330 vx: 0_i16,
16331 vy: 0_i16,
16332 vz: 0_i16,
16333 xacc: 0_i16,
16334 yacc: 0_i16,
16335 zacc: 0_i16,
16336 };
16337 #[cfg(feature = "arbitrary")]
16338 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
16339 use arbitrary::{Arbitrary, Unstructured};
16340 let mut buf = [0u8; 1024];
16341 rng.fill_bytes(&mut buf);
16342 let mut unstructured = Unstructured::new(&buf);
16343 Self::arbitrary(&mut unstructured).unwrap_or_default()
16344 }
16345}
16346impl Default for HIL_STATE_DATA {
16347 fn default() -> Self {
16348 Self::DEFAULT.clone()
16349 }
16350}
16351impl MessageData for HIL_STATE_DATA {
16352 type Message = MavMessage;
16353 const ID: u32 = 90u32;
16354 const NAME: &'static str = "HIL_STATE";
16355 const EXTRA_CRC: u8 = 183u8;
16356 const ENCODED_LEN: usize = 56usize;
16357 fn deser(
16358 _version: MavlinkVersion,
16359 __input: &[u8],
16360 ) -> Result<Self, ::mavlink_core::error::ParserError> {
16361 let avail_len = __input.len();
16362 let mut payload_buf = [0; Self::ENCODED_LEN];
16363 let mut buf = if avail_len < Self::ENCODED_LEN {
16364 payload_buf[0..avail_len].copy_from_slice(__input);
16365 Bytes::new(&payload_buf)
16366 } else {
16367 Bytes::new(__input)
16368 };
16369 let mut __struct = Self::default();
16370 __struct.time_usec = buf.get_u64_le();
16371 __struct.roll = buf.get_f32_le();
16372 __struct.pitch = buf.get_f32_le();
16373 __struct.yaw = buf.get_f32_le();
16374 __struct.rollspeed = buf.get_f32_le();
16375 __struct.pitchspeed = buf.get_f32_le();
16376 __struct.yawspeed = buf.get_f32_le();
16377 __struct.lat = buf.get_i32_le();
16378 __struct.lon = buf.get_i32_le();
16379 __struct.alt = buf.get_i32_le();
16380 __struct.vx = buf.get_i16_le();
16381 __struct.vy = buf.get_i16_le();
16382 __struct.vz = buf.get_i16_le();
16383 __struct.xacc = buf.get_i16_le();
16384 __struct.yacc = buf.get_i16_le();
16385 __struct.zacc = buf.get_i16_le();
16386 Ok(__struct)
16387 }
16388 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
16389 let mut __tmp = BytesMut::new(bytes);
16390 #[allow(clippy::absurd_extreme_comparisons)]
16391 #[allow(unused_comparisons)]
16392 if __tmp.remaining() < Self::ENCODED_LEN {
16393 panic!(
16394 "buffer is too small (need {} bytes, but got {})",
16395 Self::ENCODED_LEN,
16396 __tmp.remaining(),
16397 )
16398 }
16399 __tmp.put_u64_le(self.time_usec);
16400 __tmp.put_f32_le(self.roll);
16401 __tmp.put_f32_le(self.pitch);
16402 __tmp.put_f32_le(self.yaw);
16403 __tmp.put_f32_le(self.rollspeed);
16404 __tmp.put_f32_le(self.pitchspeed);
16405 __tmp.put_f32_le(self.yawspeed);
16406 __tmp.put_i32_le(self.lat);
16407 __tmp.put_i32_le(self.lon);
16408 __tmp.put_i32_le(self.alt);
16409 __tmp.put_i16_le(self.vx);
16410 __tmp.put_i16_le(self.vy);
16411 __tmp.put_i16_le(self.vz);
16412 __tmp.put_i16_le(self.xacc);
16413 __tmp.put_i16_le(self.yacc);
16414 __tmp.put_i16_le(self.zacc);
16415 if matches!(version, MavlinkVersion::V2) {
16416 let len = __tmp.len();
16417 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
16418 } else {
16419 __tmp.len()
16420 }
16421 }
16422}
16423#[doc = "Sent from simulation to autopilot, avoids in contrast to HIL_STATE singularities. This packet is useful for high throughput applications such as hardware in the loop simulations."]
16424#[doc = ""]
16425#[doc = "ID: 115"]
16426#[derive(Debug, Clone, PartialEq)]
16427#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
16428#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
16429pub struct HIL_STATE_QUATERNION_DATA {
16430 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
16431 pub time_usec: u64,
16432 #[doc = "Vehicle attitude expressed as normalized quaternion in w, x, y, z order (with 1 0 0 0 being the null-rotation)"]
16433 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
16434 pub attitude_quaternion: [f32; 4],
16435 #[doc = "Body frame roll / phi angular speed"]
16436 pub rollspeed: f32,
16437 #[doc = "Body frame pitch / theta angular speed"]
16438 pub pitchspeed: f32,
16439 #[doc = "Body frame yaw / psi angular speed"]
16440 pub yawspeed: f32,
16441 #[doc = "Latitude"]
16442 pub lat: i32,
16443 #[doc = "Longitude"]
16444 pub lon: i32,
16445 #[doc = "Altitude"]
16446 pub alt: i32,
16447 #[doc = "Ground X Speed (Latitude)"]
16448 pub vx: i16,
16449 #[doc = "Ground Y Speed (Longitude)"]
16450 pub vy: i16,
16451 #[doc = "Ground Z Speed (Altitude)"]
16452 pub vz: i16,
16453 #[doc = "Indicated airspeed"]
16454 pub ind_airspeed: u16,
16455 #[doc = "True airspeed"]
16456 pub true_airspeed: u16,
16457 #[doc = "X acceleration"]
16458 pub xacc: i16,
16459 #[doc = "Y acceleration"]
16460 pub yacc: i16,
16461 #[doc = "Z acceleration"]
16462 pub zacc: i16,
16463}
16464impl HIL_STATE_QUATERNION_DATA {
16465 pub const ENCODED_LEN: usize = 64usize;
16466 pub const DEFAULT: Self = Self {
16467 time_usec: 0_u64,
16468 attitude_quaternion: [0.0_f32; 4usize],
16469 rollspeed: 0.0_f32,
16470 pitchspeed: 0.0_f32,
16471 yawspeed: 0.0_f32,
16472 lat: 0_i32,
16473 lon: 0_i32,
16474 alt: 0_i32,
16475 vx: 0_i16,
16476 vy: 0_i16,
16477 vz: 0_i16,
16478 ind_airspeed: 0_u16,
16479 true_airspeed: 0_u16,
16480 xacc: 0_i16,
16481 yacc: 0_i16,
16482 zacc: 0_i16,
16483 };
16484 #[cfg(feature = "arbitrary")]
16485 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
16486 use arbitrary::{Arbitrary, Unstructured};
16487 let mut buf = [0u8; 1024];
16488 rng.fill_bytes(&mut buf);
16489 let mut unstructured = Unstructured::new(&buf);
16490 Self::arbitrary(&mut unstructured).unwrap_or_default()
16491 }
16492}
16493impl Default for HIL_STATE_QUATERNION_DATA {
16494 fn default() -> Self {
16495 Self::DEFAULT.clone()
16496 }
16497}
16498impl MessageData for HIL_STATE_QUATERNION_DATA {
16499 type Message = MavMessage;
16500 const ID: u32 = 115u32;
16501 const NAME: &'static str = "HIL_STATE_QUATERNION";
16502 const EXTRA_CRC: u8 = 4u8;
16503 const ENCODED_LEN: usize = 64usize;
16504 fn deser(
16505 _version: MavlinkVersion,
16506 __input: &[u8],
16507 ) -> Result<Self, ::mavlink_core::error::ParserError> {
16508 let avail_len = __input.len();
16509 let mut payload_buf = [0; Self::ENCODED_LEN];
16510 let mut buf = if avail_len < Self::ENCODED_LEN {
16511 payload_buf[0..avail_len].copy_from_slice(__input);
16512 Bytes::new(&payload_buf)
16513 } else {
16514 Bytes::new(__input)
16515 };
16516 let mut __struct = Self::default();
16517 __struct.time_usec = buf.get_u64_le();
16518 for v in &mut __struct.attitude_quaternion {
16519 let val = buf.get_f32_le();
16520 *v = val;
16521 }
16522 __struct.rollspeed = buf.get_f32_le();
16523 __struct.pitchspeed = buf.get_f32_le();
16524 __struct.yawspeed = buf.get_f32_le();
16525 __struct.lat = buf.get_i32_le();
16526 __struct.lon = buf.get_i32_le();
16527 __struct.alt = buf.get_i32_le();
16528 __struct.vx = buf.get_i16_le();
16529 __struct.vy = buf.get_i16_le();
16530 __struct.vz = buf.get_i16_le();
16531 __struct.ind_airspeed = buf.get_u16_le();
16532 __struct.true_airspeed = buf.get_u16_le();
16533 __struct.xacc = buf.get_i16_le();
16534 __struct.yacc = buf.get_i16_le();
16535 __struct.zacc = buf.get_i16_le();
16536 Ok(__struct)
16537 }
16538 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
16539 let mut __tmp = BytesMut::new(bytes);
16540 #[allow(clippy::absurd_extreme_comparisons)]
16541 #[allow(unused_comparisons)]
16542 if __tmp.remaining() < Self::ENCODED_LEN {
16543 panic!(
16544 "buffer is too small (need {} bytes, but got {})",
16545 Self::ENCODED_LEN,
16546 __tmp.remaining(),
16547 )
16548 }
16549 __tmp.put_u64_le(self.time_usec);
16550 for val in &self.attitude_quaternion {
16551 __tmp.put_f32_le(*val);
16552 }
16553 __tmp.put_f32_le(self.rollspeed);
16554 __tmp.put_f32_le(self.pitchspeed);
16555 __tmp.put_f32_le(self.yawspeed);
16556 __tmp.put_i32_le(self.lat);
16557 __tmp.put_i32_le(self.lon);
16558 __tmp.put_i32_le(self.alt);
16559 __tmp.put_i16_le(self.vx);
16560 __tmp.put_i16_le(self.vy);
16561 __tmp.put_i16_le(self.vz);
16562 __tmp.put_u16_le(self.ind_airspeed);
16563 __tmp.put_u16_le(self.true_airspeed);
16564 __tmp.put_i16_le(self.xacc);
16565 __tmp.put_i16_le(self.yacc);
16566 __tmp.put_i16_le(self.zacc);
16567 if matches!(version, MavlinkVersion::V2) {
16568 let len = __tmp.len();
16569 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
16570 } else {
16571 __tmp.len()
16572 }
16573 }
16574}
16575#[doc = "Contains the home position. \tThe home position is the default position that the system will return to and land on. \tThe position must be set automatically by the system during the takeoff, and may also be explicitly set using MAV_CMD_DO_SET_HOME. \tThe global and local positions encode the position in the respective coordinate frames, while the q parameter encodes the orientation of the surface. \tUnder normal conditions it describes the heading and terrain slope, which can be used by the aircraft to adjust the approach. \tThe approach 3D vector describes the point to which the system should fly in normal flight mode and then perform a landing sequence along the vector. Note: this message can be requested by sending the MAV_CMD_REQUEST_MESSAGE with param1=242 (or the deprecated MAV_CMD_GET_HOME_POSITION command)."]
16576#[doc = ""]
16577#[doc = "ID: 242"]
16578#[derive(Debug, Clone, PartialEq)]
16579#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
16580#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
16581pub struct HOME_POSITION_DATA {
16582 #[doc = "Latitude (WGS84)"]
16583 pub latitude: i32,
16584 #[doc = "Longitude (WGS84)"]
16585 pub longitude: i32,
16586 #[doc = "Altitude (MSL). Positive for up."]
16587 pub altitude: i32,
16588 #[doc = "Local X position of this position in the local coordinate frame (NED)"]
16589 pub x: f32,
16590 #[doc = "Local Y position of this position in the local coordinate frame (NED)"]
16591 pub y: f32,
16592 #[doc = "Local Z position of this position in the local coordinate frame (NED: positive \"down\")"]
16593 pub z: f32,
16594 #[doc = "Quaternion indicating world-to-surface-normal and heading transformation of the takeoff position. Used to indicate the heading and slope of the ground. All fields should be set to NaN if an accurate quaternion for both heading and surface slope cannot be supplied."]
16595 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
16596 pub q: [f32; 4],
16597 #[doc = "Local X position of the end of the approach vector. Multicopters should set this position based on their takeoff path. Grass-landing fixed wing aircraft should set it the same way as multicopters. Runway-landing fixed wing aircraft should set it to the opposite direction of the takeoff, assuming the takeoff happened from the threshold / touchdown zone."]
16598 pub approach_x: f32,
16599 #[doc = "Local Y position of the end of the approach vector. Multicopters should set this position based on their takeoff path. Grass-landing fixed wing aircraft should set it the same way as multicopters. Runway-landing fixed wing aircraft should set it to the opposite direction of the takeoff, assuming the takeoff happened from the threshold / touchdown zone."]
16600 pub approach_y: f32,
16601 #[doc = "Local Z position of the end of the approach vector. Multicopters should set this position based on their takeoff path. Grass-landing fixed wing aircraft should set it the same way as multicopters. Runway-landing fixed wing aircraft should set it to the opposite direction of the takeoff, assuming the takeoff happened from the threshold / touchdown zone."]
16602 pub approach_z: f32,
16603 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
16604 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
16605 pub time_usec: u64,
16606}
16607impl HOME_POSITION_DATA {
16608 pub const ENCODED_LEN: usize = 60usize;
16609 pub const DEFAULT: Self = Self {
16610 latitude: 0_i32,
16611 longitude: 0_i32,
16612 altitude: 0_i32,
16613 x: 0.0_f32,
16614 y: 0.0_f32,
16615 z: 0.0_f32,
16616 q: [0.0_f32; 4usize],
16617 approach_x: 0.0_f32,
16618 approach_y: 0.0_f32,
16619 approach_z: 0.0_f32,
16620 time_usec: 0_u64,
16621 };
16622 #[cfg(feature = "arbitrary")]
16623 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
16624 use arbitrary::{Arbitrary, Unstructured};
16625 let mut buf = [0u8; 1024];
16626 rng.fill_bytes(&mut buf);
16627 let mut unstructured = Unstructured::new(&buf);
16628 Self::arbitrary(&mut unstructured).unwrap_or_default()
16629 }
16630}
16631impl Default for HOME_POSITION_DATA {
16632 fn default() -> Self {
16633 Self::DEFAULT.clone()
16634 }
16635}
16636impl MessageData for HOME_POSITION_DATA {
16637 type Message = MavMessage;
16638 const ID: u32 = 242u32;
16639 const NAME: &'static str = "HOME_POSITION";
16640 const EXTRA_CRC: u8 = 104u8;
16641 const ENCODED_LEN: usize = 60usize;
16642 fn deser(
16643 _version: MavlinkVersion,
16644 __input: &[u8],
16645 ) -> Result<Self, ::mavlink_core::error::ParserError> {
16646 let avail_len = __input.len();
16647 let mut payload_buf = [0; Self::ENCODED_LEN];
16648 let mut buf = if avail_len < Self::ENCODED_LEN {
16649 payload_buf[0..avail_len].copy_from_slice(__input);
16650 Bytes::new(&payload_buf)
16651 } else {
16652 Bytes::new(__input)
16653 };
16654 let mut __struct = Self::default();
16655 __struct.latitude = buf.get_i32_le();
16656 __struct.longitude = buf.get_i32_le();
16657 __struct.altitude = buf.get_i32_le();
16658 __struct.x = buf.get_f32_le();
16659 __struct.y = buf.get_f32_le();
16660 __struct.z = buf.get_f32_le();
16661 for v in &mut __struct.q {
16662 let val = buf.get_f32_le();
16663 *v = val;
16664 }
16665 __struct.approach_x = buf.get_f32_le();
16666 __struct.approach_y = buf.get_f32_le();
16667 __struct.approach_z = buf.get_f32_le();
16668 __struct.time_usec = buf.get_u64_le();
16669 Ok(__struct)
16670 }
16671 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
16672 let mut __tmp = BytesMut::new(bytes);
16673 #[allow(clippy::absurd_extreme_comparisons)]
16674 #[allow(unused_comparisons)]
16675 if __tmp.remaining() < Self::ENCODED_LEN {
16676 panic!(
16677 "buffer is too small (need {} bytes, but got {})",
16678 Self::ENCODED_LEN,
16679 __tmp.remaining(),
16680 )
16681 }
16682 __tmp.put_i32_le(self.latitude);
16683 __tmp.put_i32_le(self.longitude);
16684 __tmp.put_i32_le(self.altitude);
16685 __tmp.put_f32_le(self.x);
16686 __tmp.put_f32_le(self.y);
16687 __tmp.put_f32_le(self.z);
16688 for val in &self.q {
16689 __tmp.put_f32_le(*val);
16690 }
16691 __tmp.put_f32_le(self.approach_x);
16692 __tmp.put_f32_le(self.approach_y);
16693 __tmp.put_f32_le(self.approach_z);
16694 if matches!(version, MavlinkVersion::V2) {
16695 __tmp.put_u64_le(self.time_usec);
16696 let len = __tmp.len();
16697 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
16698 } else {
16699 __tmp.len()
16700 }
16701 }
16702}
16703#[doc = "Temperature and humidity from hygrometer."]
16704#[doc = ""]
16705#[doc = "ID: 12920"]
16706#[derive(Debug, Clone, PartialEq)]
16707#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
16708#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
16709pub struct HYGROMETER_SENSOR_DATA {
16710 #[doc = "Temperature"]
16711 pub temperature: i16,
16712 #[doc = "Humidity"]
16713 pub humidity: u16,
16714 #[doc = "Hygrometer ID"]
16715 pub id: u8,
16716}
16717impl HYGROMETER_SENSOR_DATA {
16718 pub const ENCODED_LEN: usize = 5usize;
16719 pub const DEFAULT: Self = Self {
16720 temperature: 0_i16,
16721 humidity: 0_u16,
16722 id: 0_u8,
16723 };
16724 #[cfg(feature = "arbitrary")]
16725 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
16726 use arbitrary::{Arbitrary, Unstructured};
16727 let mut buf = [0u8; 1024];
16728 rng.fill_bytes(&mut buf);
16729 let mut unstructured = Unstructured::new(&buf);
16730 Self::arbitrary(&mut unstructured).unwrap_or_default()
16731 }
16732}
16733impl Default for HYGROMETER_SENSOR_DATA {
16734 fn default() -> Self {
16735 Self::DEFAULT.clone()
16736 }
16737}
16738impl MessageData for HYGROMETER_SENSOR_DATA {
16739 type Message = MavMessage;
16740 const ID: u32 = 12920u32;
16741 const NAME: &'static str = "HYGROMETER_SENSOR";
16742 const EXTRA_CRC: u8 = 20u8;
16743 const ENCODED_LEN: usize = 5usize;
16744 fn deser(
16745 _version: MavlinkVersion,
16746 __input: &[u8],
16747 ) -> Result<Self, ::mavlink_core::error::ParserError> {
16748 let avail_len = __input.len();
16749 let mut payload_buf = [0; Self::ENCODED_LEN];
16750 let mut buf = if avail_len < Self::ENCODED_LEN {
16751 payload_buf[0..avail_len].copy_from_slice(__input);
16752 Bytes::new(&payload_buf)
16753 } else {
16754 Bytes::new(__input)
16755 };
16756 let mut __struct = Self::default();
16757 __struct.temperature = buf.get_i16_le();
16758 __struct.humidity = buf.get_u16_le();
16759 __struct.id = buf.get_u8();
16760 Ok(__struct)
16761 }
16762 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
16763 let mut __tmp = BytesMut::new(bytes);
16764 #[allow(clippy::absurd_extreme_comparisons)]
16765 #[allow(unused_comparisons)]
16766 if __tmp.remaining() < Self::ENCODED_LEN {
16767 panic!(
16768 "buffer is too small (need {} bytes, but got {})",
16769 Self::ENCODED_LEN,
16770 __tmp.remaining(),
16771 )
16772 }
16773 __tmp.put_i16_le(self.temperature);
16774 __tmp.put_u16_le(self.humidity);
16775 __tmp.put_u8(self.id);
16776 if matches!(version, MavlinkVersion::V2) {
16777 let len = __tmp.len();
16778 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
16779 } else {
16780 __tmp.len()
16781 }
16782 }
16783}
16784#[doc = "Illuminator status."]
16785#[doc = ""]
16786#[doc = "ID: 440"]
16787#[derive(Debug, Clone, PartialEq)]
16788#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
16789#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
16790pub struct ILLUMINATOR_STATUS_DATA {
16791 #[doc = "Time since the start-up of the illuminator in ms"]
16792 pub uptime_ms: u32,
16793 #[doc = "Errors"]
16794 pub error_status: IlluminatorErrorFlags,
16795 #[doc = "Illuminator brightness"]
16796 pub brightness: f32,
16797 #[doc = "Illuminator strobing period in seconds"]
16798 pub strobe_period: f32,
16799 #[doc = "Illuminator strobing duty cycle"]
16800 pub strobe_duty_cycle: f32,
16801 #[doc = "Temperature in Celsius"]
16802 pub temp_c: f32,
16803 #[doc = "Minimum strobing period in seconds"]
16804 pub min_strobe_period: f32,
16805 #[doc = "Maximum strobing period in seconds"]
16806 pub max_strobe_period: f32,
16807 #[doc = "0: Illuminators OFF, 1: Illuminators ON"]
16808 pub enable: u8,
16809 #[doc = "Supported illuminator modes"]
16810 pub mode_bitmask: IlluminatorMode,
16811 #[doc = "Illuminator mode"]
16812 pub mode: IlluminatorMode,
16813}
16814impl ILLUMINATOR_STATUS_DATA {
16815 pub const ENCODED_LEN: usize = 35usize;
16816 pub const DEFAULT: Self = Self {
16817 uptime_ms: 0_u32,
16818 error_status: IlluminatorErrorFlags::DEFAULT,
16819 brightness: 0.0_f32,
16820 strobe_period: 0.0_f32,
16821 strobe_duty_cycle: 0.0_f32,
16822 temp_c: 0.0_f32,
16823 min_strobe_period: 0.0_f32,
16824 max_strobe_period: 0.0_f32,
16825 enable: 0_u8,
16826 mode_bitmask: IlluminatorMode::DEFAULT,
16827 mode: IlluminatorMode::DEFAULT,
16828 };
16829 #[cfg(feature = "arbitrary")]
16830 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
16831 use arbitrary::{Arbitrary, Unstructured};
16832 let mut buf = [0u8; 1024];
16833 rng.fill_bytes(&mut buf);
16834 let mut unstructured = Unstructured::new(&buf);
16835 Self::arbitrary(&mut unstructured).unwrap_or_default()
16836 }
16837}
16838impl Default for ILLUMINATOR_STATUS_DATA {
16839 fn default() -> Self {
16840 Self::DEFAULT.clone()
16841 }
16842}
16843impl MessageData for ILLUMINATOR_STATUS_DATA {
16844 type Message = MavMessage;
16845 const ID: u32 = 440u32;
16846 const NAME: &'static str = "ILLUMINATOR_STATUS";
16847 const EXTRA_CRC: u8 = 66u8;
16848 const ENCODED_LEN: usize = 35usize;
16849 fn deser(
16850 _version: MavlinkVersion,
16851 __input: &[u8],
16852 ) -> Result<Self, ::mavlink_core::error::ParserError> {
16853 let avail_len = __input.len();
16854 let mut payload_buf = [0; Self::ENCODED_LEN];
16855 let mut buf = if avail_len < Self::ENCODED_LEN {
16856 payload_buf[0..avail_len].copy_from_slice(__input);
16857 Bytes::new(&payload_buf)
16858 } else {
16859 Bytes::new(__input)
16860 };
16861 let mut __struct = Self::default();
16862 __struct.uptime_ms = buf.get_u32_le();
16863 let tmp = buf.get_u32_le();
16864 __struct.error_status = IlluminatorErrorFlags::from_bits(
16865 tmp & IlluminatorErrorFlags::all().bits(),
16866 )
16867 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
16868 flag_type: "IlluminatorErrorFlags",
16869 value: tmp as u32,
16870 })?;
16871 __struct.brightness = buf.get_f32_le();
16872 __struct.strobe_period = buf.get_f32_le();
16873 __struct.strobe_duty_cycle = buf.get_f32_le();
16874 __struct.temp_c = buf.get_f32_le();
16875 __struct.min_strobe_period = buf.get_f32_le();
16876 __struct.max_strobe_period = buf.get_f32_le();
16877 __struct.enable = buf.get_u8();
16878 let tmp = buf.get_u8();
16879 __struct.mode_bitmask =
16880 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
16881 enum_type: "IlluminatorMode",
16882 value: tmp as u32,
16883 })?;
16884 let tmp = buf.get_u8();
16885 __struct.mode =
16886 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
16887 enum_type: "IlluminatorMode",
16888 value: tmp as u32,
16889 })?;
16890 Ok(__struct)
16891 }
16892 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
16893 let mut __tmp = BytesMut::new(bytes);
16894 #[allow(clippy::absurd_extreme_comparisons)]
16895 #[allow(unused_comparisons)]
16896 if __tmp.remaining() < Self::ENCODED_LEN {
16897 panic!(
16898 "buffer is too small (need {} bytes, but got {})",
16899 Self::ENCODED_LEN,
16900 __tmp.remaining(),
16901 )
16902 }
16903 __tmp.put_u32_le(self.uptime_ms);
16904 __tmp.put_u32_le(self.error_status.bits());
16905 __tmp.put_f32_le(self.brightness);
16906 __tmp.put_f32_le(self.strobe_period);
16907 __tmp.put_f32_le(self.strobe_duty_cycle);
16908 __tmp.put_f32_le(self.temp_c);
16909 __tmp.put_f32_le(self.min_strobe_period);
16910 __tmp.put_f32_le(self.max_strobe_period);
16911 __tmp.put_u8(self.enable);
16912 __tmp.put_u8(self.mode_bitmask as u8);
16913 __tmp.put_u8(self.mode as u8);
16914 if matches!(version, MavlinkVersion::V2) {
16915 let len = __tmp.len();
16916 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
16917 } else {
16918 __tmp.len()
16919 }
16920 }
16921}
16922#[doc = "Status of the Iridium SBD link."]
16923#[doc = ""]
16924#[doc = "ID: 335"]
16925#[derive(Debug, Clone, PartialEq)]
16926#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
16927#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
16928pub struct ISBD_LINK_STATUS_DATA {
16929 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
16930 pub timestamp: u64,
16931 #[doc = "Timestamp of the last successful sbd session. The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
16932 pub last_heartbeat: u64,
16933 #[doc = "Number of failed SBD sessions."]
16934 pub failed_sessions: u16,
16935 #[doc = "Number of successful SBD sessions."]
16936 pub successful_sessions: u16,
16937 #[doc = "Signal quality equal to the number of bars displayed on the ISU signal strength indicator. Range is 0 to 5, where 0 indicates no signal and 5 indicates maximum signal strength."]
16938 pub signal_quality: u8,
16939 #[doc = "1: Ring call pending, 0: No call pending."]
16940 pub ring_pending: u8,
16941 #[doc = "1: Transmission session pending, 0: No transmission session pending."]
16942 pub tx_session_pending: u8,
16943 #[doc = "1: Receiving session pending, 0: No receiving session pending."]
16944 pub rx_session_pending: u8,
16945}
16946impl ISBD_LINK_STATUS_DATA {
16947 pub const ENCODED_LEN: usize = 24usize;
16948 pub const DEFAULT: Self = Self {
16949 timestamp: 0_u64,
16950 last_heartbeat: 0_u64,
16951 failed_sessions: 0_u16,
16952 successful_sessions: 0_u16,
16953 signal_quality: 0_u8,
16954 ring_pending: 0_u8,
16955 tx_session_pending: 0_u8,
16956 rx_session_pending: 0_u8,
16957 };
16958 #[cfg(feature = "arbitrary")]
16959 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
16960 use arbitrary::{Arbitrary, Unstructured};
16961 let mut buf = [0u8; 1024];
16962 rng.fill_bytes(&mut buf);
16963 let mut unstructured = Unstructured::new(&buf);
16964 Self::arbitrary(&mut unstructured).unwrap_or_default()
16965 }
16966}
16967impl Default for ISBD_LINK_STATUS_DATA {
16968 fn default() -> Self {
16969 Self::DEFAULT.clone()
16970 }
16971}
16972impl MessageData for ISBD_LINK_STATUS_DATA {
16973 type Message = MavMessage;
16974 const ID: u32 = 335u32;
16975 const NAME: &'static str = "ISBD_LINK_STATUS";
16976 const EXTRA_CRC: u8 = 225u8;
16977 const ENCODED_LEN: usize = 24usize;
16978 fn deser(
16979 _version: MavlinkVersion,
16980 __input: &[u8],
16981 ) -> Result<Self, ::mavlink_core::error::ParserError> {
16982 let avail_len = __input.len();
16983 let mut payload_buf = [0; Self::ENCODED_LEN];
16984 let mut buf = if avail_len < Self::ENCODED_LEN {
16985 payload_buf[0..avail_len].copy_from_slice(__input);
16986 Bytes::new(&payload_buf)
16987 } else {
16988 Bytes::new(__input)
16989 };
16990 let mut __struct = Self::default();
16991 __struct.timestamp = buf.get_u64_le();
16992 __struct.last_heartbeat = buf.get_u64_le();
16993 __struct.failed_sessions = buf.get_u16_le();
16994 __struct.successful_sessions = buf.get_u16_le();
16995 __struct.signal_quality = buf.get_u8();
16996 __struct.ring_pending = buf.get_u8();
16997 __struct.tx_session_pending = buf.get_u8();
16998 __struct.rx_session_pending = buf.get_u8();
16999 Ok(__struct)
17000 }
17001 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
17002 let mut __tmp = BytesMut::new(bytes);
17003 #[allow(clippy::absurd_extreme_comparisons)]
17004 #[allow(unused_comparisons)]
17005 if __tmp.remaining() < Self::ENCODED_LEN {
17006 panic!(
17007 "buffer is too small (need {} bytes, but got {})",
17008 Self::ENCODED_LEN,
17009 __tmp.remaining(),
17010 )
17011 }
17012 __tmp.put_u64_le(self.timestamp);
17013 __tmp.put_u64_le(self.last_heartbeat);
17014 __tmp.put_u16_le(self.failed_sessions);
17015 __tmp.put_u16_le(self.successful_sessions);
17016 __tmp.put_u8(self.signal_quality);
17017 __tmp.put_u8(self.ring_pending);
17018 __tmp.put_u8(self.tx_session_pending);
17019 __tmp.put_u8(self.rx_session_pending);
17020 if matches!(version, MavlinkVersion::V2) {
17021 let len = __tmp.len();
17022 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
17023 } else {
17024 __tmp.len()
17025 }
17026 }
17027}
17028#[doc = "The location of a landing target. See: <https://mavlink.io/en/services/landing_target.html>."]
17029#[doc = ""]
17030#[doc = "ID: 149"]
17031#[derive(Debug, Clone, PartialEq)]
17032#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
17033#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
17034pub struct LANDING_TARGET_DATA {
17035 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
17036 pub time_usec: u64,
17037 #[doc = "X-axis angular offset of the target from the center of the image"]
17038 pub angle_x: f32,
17039 #[doc = "Y-axis angular offset of the target from the center of the image"]
17040 pub angle_y: f32,
17041 #[doc = "Distance to the target from the vehicle"]
17042 pub distance: f32,
17043 #[doc = "Size of target along x-axis"]
17044 pub size_x: f32,
17045 #[doc = "Size of target along y-axis"]
17046 pub size_y: f32,
17047 #[doc = "The ID of the target if multiple targets are present"]
17048 pub target_num: u8,
17049 #[doc = "Coordinate frame used for following fields."]
17050 pub frame: MavFrame,
17051 #[doc = "X Position of the landing target in MAV_FRAME"]
17052 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
17053 pub x: f32,
17054 #[doc = "Y Position of the landing target in MAV_FRAME"]
17055 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
17056 pub y: f32,
17057 #[doc = "Z Position of the landing target in MAV_FRAME"]
17058 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
17059 pub z: f32,
17060 #[doc = "Quaternion of landing target orientation (w, x, y, z order, zero-rotation is 1, 0, 0, 0)"]
17061 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
17062 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
17063 pub q: [f32; 4],
17064 #[doc = "Type of landing target"]
17065 #[cfg_attr(feature = "serde", serde(default))]
17066 pub mavtype: LandingTargetType,
17067 #[doc = "Boolean indicating whether the position fields (x, y, z, q, type) contain valid target position information (valid: 1, invalid: 0). Default is 0 (invalid)."]
17068 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
17069 pub position_valid: u8,
17070}
17071impl LANDING_TARGET_DATA {
17072 pub const ENCODED_LEN: usize = 60usize;
17073 pub const DEFAULT: Self = Self {
17074 time_usec: 0_u64,
17075 angle_x: 0.0_f32,
17076 angle_y: 0.0_f32,
17077 distance: 0.0_f32,
17078 size_x: 0.0_f32,
17079 size_y: 0.0_f32,
17080 target_num: 0_u8,
17081 frame: MavFrame::DEFAULT,
17082 x: 0.0_f32,
17083 y: 0.0_f32,
17084 z: 0.0_f32,
17085 q: [0.0_f32; 4usize],
17086 mavtype: LandingTargetType::DEFAULT,
17087 position_valid: 0_u8,
17088 };
17089 #[cfg(feature = "arbitrary")]
17090 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
17091 use arbitrary::{Arbitrary, Unstructured};
17092 let mut buf = [0u8; 1024];
17093 rng.fill_bytes(&mut buf);
17094 let mut unstructured = Unstructured::new(&buf);
17095 Self::arbitrary(&mut unstructured).unwrap_or_default()
17096 }
17097}
17098impl Default for LANDING_TARGET_DATA {
17099 fn default() -> Self {
17100 Self::DEFAULT.clone()
17101 }
17102}
17103impl MessageData for LANDING_TARGET_DATA {
17104 type Message = MavMessage;
17105 const ID: u32 = 149u32;
17106 const NAME: &'static str = "LANDING_TARGET";
17107 const EXTRA_CRC: u8 = 200u8;
17108 const ENCODED_LEN: usize = 60usize;
17109 fn deser(
17110 _version: MavlinkVersion,
17111 __input: &[u8],
17112 ) -> Result<Self, ::mavlink_core::error::ParserError> {
17113 let avail_len = __input.len();
17114 let mut payload_buf = [0; Self::ENCODED_LEN];
17115 let mut buf = if avail_len < Self::ENCODED_LEN {
17116 payload_buf[0..avail_len].copy_from_slice(__input);
17117 Bytes::new(&payload_buf)
17118 } else {
17119 Bytes::new(__input)
17120 };
17121 let mut __struct = Self::default();
17122 __struct.time_usec = buf.get_u64_le();
17123 __struct.angle_x = buf.get_f32_le();
17124 __struct.angle_y = buf.get_f32_le();
17125 __struct.distance = buf.get_f32_le();
17126 __struct.size_x = buf.get_f32_le();
17127 __struct.size_y = buf.get_f32_le();
17128 __struct.target_num = buf.get_u8();
17129 let tmp = buf.get_u8();
17130 __struct.frame =
17131 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
17132 enum_type: "MavFrame",
17133 value: tmp as u32,
17134 })?;
17135 __struct.x = buf.get_f32_le();
17136 __struct.y = buf.get_f32_le();
17137 __struct.z = buf.get_f32_le();
17138 for v in &mut __struct.q {
17139 let val = buf.get_f32_le();
17140 *v = val;
17141 }
17142 let tmp = buf.get_u8();
17143 __struct.mavtype =
17144 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
17145 enum_type: "LandingTargetType",
17146 value: tmp as u32,
17147 })?;
17148 __struct.position_valid = buf.get_u8();
17149 Ok(__struct)
17150 }
17151 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
17152 let mut __tmp = BytesMut::new(bytes);
17153 #[allow(clippy::absurd_extreme_comparisons)]
17154 #[allow(unused_comparisons)]
17155 if __tmp.remaining() < Self::ENCODED_LEN {
17156 panic!(
17157 "buffer is too small (need {} bytes, but got {})",
17158 Self::ENCODED_LEN,
17159 __tmp.remaining(),
17160 )
17161 }
17162 __tmp.put_u64_le(self.time_usec);
17163 __tmp.put_f32_le(self.angle_x);
17164 __tmp.put_f32_le(self.angle_y);
17165 __tmp.put_f32_le(self.distance);
17166 __tmp.put_f32_le(self.size_x);
17167 __tmp.put_f32_le(self.size_y);
17168 __tmp.put_u8(self.target_num);
17169 __tmp.put_u8(self.frame as u8);
17170 if matches!(version, MavlinkVersion::V2) {
17171 __tmp.put_f32_le(self.x);
17172 __tmp.put_f32_le(self.y);
17173 __tmp.put_f32_le(self.z);
17174 for val in &self.q {
17175 __tmp.put_f32_le(*val);
17176 }
17177 __tmp.put_u8(self.mavtype as u8);
17178 __tmp.put_u8(self.position_valid);
17179 let len = __tmp.len();
17180 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
17181 } else {
17182 __tmp.len()
17183 }
17184 }
17185}
17186#[doc = "Status generated in each node in the communication chain and injected into MAVLink stream."]
17187#[doc = ""]
17188#[doc = "ID: 8"]
17189#[derive(Debug, Clone, PartialEq)]
17190#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
17191#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
17192pub struct LINK_NODE_STATUS_DATA {
17193 #[doc = "Timestamp (time since system boot)."]
17194 pub timestamp: u64,
17195 #[doc = "Transmit rate"]
17196 pub tx_rate: u32,
17197 #[doc = "Receive rate"]
17198 pub rx_rate: u32,
17199 #[doc = "Messages sent"]
17200 pub messages_sent: u32,
17201 #[doc = "Messages received (estimated from counting seq)"]
17202 pub messages_received: u32,
17203 #[doc = "Messages lost (estimated from counting seq)"]
17204 pub messages_lost: u32,
17205 #[doc = "Number of bytes that could not be parsed correctly."]
17206 pub rx_parse_err: u16,
17207 #[doc = "Transmit buffer overflows. This number wraps around as it reaches UINT16_MAX"]
17208 pub tx_overflows: u16,
17209 #[doc = "Receive buffer overflows. This number wraps around as it reaches UINT16_MAX"]
17210 pub rx_overflows: u16,
17211 #[doc = "Remaining free transmit buffer space"]
17212 pub tx_buf: u8,
17213 #[doc = "Remaining free receive buffer space"]
17214 pub rx_buf: u8,
17215}
17216impl LINK_NODE_STATUS_DATA {
17217 pub const ENCODED_LEN: usize = 36usize;
17218 pub const DEFAULT: Self = Self {
17219 timestamp: 0_u64,
17220 tx_rate: 0_u32,
17221 rx_rate: 0_u32,
17222 messages_sent: 0_u32,
17223 messages_received: 0_u32,
17224 messages_lost: 0_u32,
17225 rx_parse_err: 0_u16,
17226 tx_overflows: 0_u16,
17227 rx_overflows: 0_u16,
17228 tx_buf: 0_u8,
17229 rx_buf: 0_u8,
17230 };
17231 #[cfg(feature = "arbitrary")]
17232 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
17233 use arbitrary::{Arbitrary, Unstructured};
17234 let mut buf = [0u8; 1024];
17235 rng.fill_bytes(&mut buf);
17236 let mut unstructured = Unstructured::new(&buf);
17237 Self::arbitrary(&mut unstructured).unwrap_or_default()
17238 }
17239}
17240impl Default for LINK_NODE_STATUS_DATA {
17241 fn default() -> Self {
17242 Self::DEFAULT.clone()
17243 }
17244}
17245impl MessageData for LINK_NODE_STATUS_DATA {
17246 type Message = MavMessage;
17247 const ID: u32 = 8u32;
17248 const NAME: &'static str = "LINK_NODE_STATUS";
17249 const EXTRA_CRC: u8 = 117u8;
17250 const ENCODED_LEN: usize = 36usize;
17251 fn deser(
17252 _version: MavlinkVersion,
17253 __input: &[u8],
17254 ) -> Result<Self, ::mavlink_core::error::ParserError> {
17255 let avail_len = __input.len();
17256 let mut payload_buf = [0; Self::ENCODED_LEN];
17257 let mut buf = if avail_len < Self::ENCODED_LEN {
17258 payload_buf[0..avail_len].copy_from_slice(__input);
17259 Bytes::new(&payload_buf)
17260 } else {
17261 Bytes::new(__input)
17262 };
17263 let mut __struct = Self::default();
17264 __struct.timestamp = buf.get_u64_le();
17265 __struct.tx_rate = buf.get_u32_le();
17266 __struct.rx_rate = buf.get_u32_le();
17267 __struct.messages_sent = buf.get_u32_le();
17268 __struct.messages_received = buf.get_u32_le();
17269 __struct.messages_lost = buf.get_u32_le();
17270 __struct.rx_parse_err = buf.get_u16_le();
17271 __struct.tx_overflows = buf.get_u16_le();
17272 __struct.rx_overflows = buf.get_u16_le();
17273 __struct.tx_buf = buf.get_u8();
17274 __struct.rx_buf = buf.get_u8();
17275 Ok(__struct)
17276 }
17277 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
17278 let mut __tmp = BytesMut::new(bytes);
17279 #[allow(clippy::absurd_extreme_comparisons)]
17280 #[allow(unused_comparisons)]
17281 if __tmp.remaining() < Self::ENCODED_LEN {
17282 panic!(
17283 "buffer is too small (need {} bytes, but got {})",
17284 Self::ENCODED_LEN,
17285 __tmp.remaining(),
17286 )
17287 }
17288 __tmp.put_u64_le(self.timestamp);
17289 __tmp.put_u32_le(self.tx_rate);
17290 __tmp.put_u32_le(self.rx_rate);
17291 __tmp.put_u32_le(self.messages_sent);
17292 __tmp.put_u32_le(self.messages_received);
17293 __tmp.put_u32_le(self.messages_lost);
17294 __tmp.put_u16_le(self.rx_parse_err);
17295 __tmp.put_u16_le(self.tx_overflows);
17296 __tmp.put_u16_le(self.rx_overflows);
17297 __tmp.put_u8(self.tx_buf);
17298 __tmp.put_u8(self.rx_buf);
17299 if matches!(version, MavlinkVersion::V2) {
17300 let len = __tmp.len();
17301 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
17302 } else {
17303 __tmp.len()
17304 }
17305 }
17306}
17307#[doc = "The filtered local position (e.g. fused computer vision and accelerometers). Coordinate frame is right-handed, Z-axis down (aeronautical frame, NED / north-east-down convention)."]
17308#[doc = ""]
17309#[doc = "ID: 32"]
17310#[derive(Debug, Clone, PartialEq)]
17311#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
17312#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
17313pub struct LOCAL_POSITION_NED_DATA {
17314 #[doc = "Timestamp (time since system boot)."]
17315 pub time_boot_ms: u32,
17316 #[doc = "X Position"]
17317 pub x: f32,
17318 #[doc = "Y Position"]
17319 pub y: f32,
17320 #[doc = "Z Position"]
17321 pub z: f32,
17322 #[doc = "X Speed"]
17323 pub vx: f32,
17324 #[doc = "Y Speed"]
17325 pub vy: f32,
17326 #[doc = "Z Speed"]
17327 pub vz: f32,
17328}
17329impl LOCAL_POSITION_NED_DATA {
17330 pub const ENCODED_LEN: usize = 28usize;
17331 pub const DEFAULT: Self = Self {
17332 time_boot_ms: 0_u32,
17333 x: 0.0_f32,
17334 y: 0.0_f32,
17335 z: 0.0_f32,
17336 vx: 0.0_f32,
17337 vy: 0.0_f32,
17338 vz: 0.0_f32,
17339 };
17340 #[cfg(feature = "arbitrary")]
17341 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
17342 use arbitrary::{Arbitrary, Unstructured};
17343 let mut buf = [0u8; 1024];
17344 rng.fill_bytes(&mut buf);
17345 let mut unstructured = Unstructured::new(&buf);
17346 Self::arbitrary(&mut unstructured).unwrap_or_default()
17347 }
17348}
17349impl Default for LOCAL_POSITION_NED_DATA {
17350 fn default() -> Self {
17351 Self::DEFAULT.clone()
17352 }
17353}
17354impl MessageData for LOCAL_POSITION_NED_DATA {
17355 type Message = MavMessage;
17356 const ID: u32 = 32u32;
17357 const NAME: &'static str = "LOCAL_POSITION_NED";
17358 const EXTRA_CRC: u8 = 185u8;
17359 const ENCODED_LEN: usize = 28usize;
17360 fn deser(
17361 _version: MavlinkVersion,
17362 __input: &[u8],
17363 ) -> Result<Self, ::mavlink_core::error::ParserError> {
17364 let avail_len = __input.len();
17365 let mut payload_buf = [0; Self::ENCODED_LEN];
17366 let mut buf = if avail_len < Self::ENCODED_LEN {
17367 payload_buf[0..avail_len].copy_from_slice(__input);
17368 Bytes::new(&payload_buf)
17369 } else {
17370 Bytes::new(__input)
17371 };
17372 let mut __struct = Self::default();
17373 __struct.time_boot_ms = buf.get_u32_le();
17374 __struct.x = buf.get_f32_le();
17375 __struct.y = buf.get_f32_le();
17376 __struct.z = buf.get_f32_le();
17377 __struct.vx = buf.get_f32_le();
17378 __struct.vy = buf.get_f32_le();
17379 __struct.vz = buf.get_f32_le();
17380 Ok(__struct)
17381 }
17382 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
17383 let mut __tmp = BytesMut::new(bytes);
17384 #[allow(clippy::absurd_extreme_comparisons)]
17385 #[allow(unused_comparisons)]
17386 if __tmp.remaining() < Self::ENCODED_LEN {
17387 panic!(
17388 "buffer is too small (need {} bytes, but got {})",
17389 Self::ENCODED_LEN,
17390 __tmp.remaining(),
17391 )
17392 }
17393 __tmp.put_u32_le(self.time_boot_ms);
17394 __tmp.put_f32_le(self.x);
17395 __tmp.put_f32_le(self.y);
17396 __tmp.put_f32_le(self.z);
17397 __tmp.put_f32_le(self.vx);
17398 __tmp.put_f32_le(self.vy);
17399 __tmp.put_f32_le(self.vz);
17400 if matches!(version, MavlinkVersion::V2) {
17401 let len = __tmp.len();
17402 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
17403 } else {
17404 __tmp.len()
17405 }
17406 }
17407}
17408#[doc = "The filtered local position (e.g. fused computer vision and accelerometers). Coordinate frame is right-handed, Z-axis down (aeronautical frame, NED / north-east-down convention)."]
17409#[doc = ""]
17410#[doc = "ID: 64"]
17411#[derive(Debug, Clone, PartialEq)]
17412#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
17413#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
17414pub struct LOCAL_POSITION_NED_COV_DATA {
17415 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
17416 pub time_usec: u64,
17417 #[doc = "X Position"]
17418 pub x: f32,
17419 #[doc = "Y Position"]
17420 pub y: f32,
17421 #[doc = "Z Position"]
17422 pub z: f32,
17423 #[doc = "X Speed"]
17424 pub vx: f32,
17425 #[doc = "Y Speed"]
17426 pub vy: f32,
17427 #[doc = "Z Speed"]
17428 pub vz: f32,
17429 #[doc = "X Acceleration"]
17430 pub ax: f32,
17431 #[doc = "Y Acceleration"]
17432 pub ay: f32,
17433 #[doc = "Z Acceleration"]
17434 pub az: f32,
17435 #[doc = "Row-major representation of position, velocity and acceleration 9x9 cross-covariance matrix upper right triangle (states: x, y, z, vx, vy, vz, ax, ay, az; first nine entries are the first ROW, next eight entries are the second row, etc.). If unknown, assign NaN value to first element in the array."]
17436 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
17437 pub covariance: [f32; 45],
17438 #[doc = "Class id of the estimator this estimate originated from."]
17439 pub estimator_type: MavEstimatorType,
17440}
17441impl LOCAL_POSITION_NED_COV_DATA {
17442 pub const ENCODED_LEN: usize = 225usize;
17443 pub const DEFAULT: Self = Self {
17444 time_usec: 0_u64,
17445 x: 0.0_f32,
17446 y: 0.0_f32,
17447 z: 0.0_f32,
17448 vx: 0.0_f32,
17449 vy: 0.0_f32,
17450 vz: 0.0_f32,
17451 ax: 0.0_f32,
17452 ay: 0.0_f32,
17453 az: 0.0_f32,
17454 covariance: [0.0_f32; 45usize],
17455 estimator_type: MavEstimatorType::DEFAULT,
17456 };
17457 #[cfg(feature = "arbitrary")]
17458 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
17459 use arbitrary::{Arbitrary, Unstructured};
17460 let mut buf = [0u8; 1024];
17461 rng.fill_bytes(&mut buf);
17462 let mut unstructured = Unstructured::new(&buf);
17463 Self::arbitrary(&mut unstructured).unwrap_or_default()
17464 }
17465}
17466impl Default for LOCAL_POSITION_NED_COV_DATA {
17467 fn default() -> Self {
17468 Self::DEFAULT.clone()
17469 }
17470}
17471impl MessageData for LOCAL_POSITION_NED_COV_DATA {
17472 type Message = MavMessage;
17473 const ID: u32 = 64u32;
17474 const NAME: &'static str = "LOCAL_POSITION_NED_COV";
17475 const EXTRA_CRC: u8 = 191u8;
17476 const ENCODED_LEN: usize = 225usize;
17477 fn deser(
17478 _version: MavlinkVersion,
17479 __input: &[u8],
17480 ) -> Result<Self, ::mavlink_core::error::ParserError> {
17481 let avail_len = __input.len();
17482 let mut payload_buf = [0; Self::ENCODED_LEN];
17483 let mut buf = if avail_len < Self::ENCODED_LEN {
17484 payload_buf[0..avail_len].copy_from_slice(__input);
17485 Bytes::new(&payload_buf)
17486 } else {
17487 Bytes::new(__input)
17488 };
17489 let mut __struct = Self::default();
17490 __struct.time_usec = buf.get_u64_le();
17491 __struct.x = buf.get_f32_le();
17492 __struct.y = buf.get_f32_le();
17493 __struct.z = buf.get_f32_le();
17494 __struct.vx = buf.get_f32_le();
17495 __struct.vy = buf.get_f32_le();
17496 __struct.vz = buf.get_f32_le();
17497 __struct.ax = buf.get_f32_le();
17498 __struct.ay = buf.get_f32_le();
17499 __struct.az = buf.get_f32_le();
17500 for v in &mut __struct.covariance {
17501 let val = buf.get_f32_le();
17502 *v = val;
17503 }
17504 let tmp = buf.get_u8();
17505 __struct.estimator_type =
17506 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
17507 enum_type: "MavEstimatorType",
17508 value: tmp as u32,
17509 })?;
17510 Ok(__struct)
17511 }
17512 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
17513 let mut __tmp = BytesMut::new(bytes);
17514 #[allow(clippy::absurd_extreme_comparisons)]
17515 #[allow(unused_comparisons)]
17516 if __tmp.remaining() < Self::ENCODED_LEN {
17517 panic!(
17518 "buffer is too small (need {} bytes, but got {})",
17519 Self::ENCODED_LEN,
17520 __tmp.remaining(),
17521 )
17522 }
17523 __tmp.put_u64_le(self.time_usec);
17524 __tmp.put_f32_le(self.x);
17525 __tmp.put_f32_le(self.y);
17526 __tmp.put_f32_le(self.z);
17527 __tmp.put_f32_le(self.vx);
17528 __tmp.put_f32_le(self.vy);
17529 __tmp.put_f32_le(self.vz);
17530 __tmp.put_f32_le(self.ax);
17531 __tmp.put_f32_le(self.ay);
17532 __tmp.put_f32_le(self.az);
17533 for val in &self.covariance {
17534 __tmp.put_f32_le(*val);
17535 }
17536 __tmp.put_u8(self.estimator_type as u8);
17537 if matches!(version, MavlinkVersion::V2) {
17538 let len = __tmp.len();
17539 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
17540 } else {
17541 __tmp.len()
17542 }
17543 }
17544}
17545#[doc = "The offset in X, Y, Z and yaw between the LOCAL_POSITION_NED messages of MAV X and the global coordinate frame in NED coordinates. Coordinate frame is right-handed, Z-axis down (aeronautical frame, NED / north-east-down convention)."]
17546#[doc = ""]
17547#[doc = "ID: 89"]
17548#[derive(Debug, Clone, PartialEq)]
17549#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
17550#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
17551pub struct LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA {
17552 #[doc = "Timestamp (time since system boot)."]
17553 pub time_boot_ms: u32,
17554 #[doc = "X Position"]
17555 pub x: f32,
17556 #[doc = "Y Position"]
17557 pub y: f32,
17558 #[doc = "Z Position"]
17559 pub z: f32,
17560 #[doc = "Roll"]
17561 pub roll: f32,
17562 #[doc = "Pitch"]
17563 pub pitch: f32,
17564 #[doc = "Yaw"]
17565 pub yaw: f32,
17566}
17567impl LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA {
17568 pub const ENCODED_LEN: usize = 28usize;
17569 pub const DEFAULT: Self = Self {
17570 time_boot_ms: 0_u32,
17571 x: 0.0_f32,
17572 y: 0.0_f32,
17573 z: 0.0_f32,
17574 roll: 0.0_f32,
17575 pitch: 0.0_f32,
17576 yaw: 0.0_f32,
17577 };
17578 #[cfg(feature = "arbitrary")]
17579 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
17580 use arbitrary::{Arbitrary, Unstructured};
17581 let mut buf = [0u8; 1024];
17582 rng.fill_bytes(&mut buf);
17583 let mut unstructured = Unstructured::new(&buf);
17584 Self::arbitrary(&mut unstructured).unwrap_or_default()
17585 }
17586}
17587impl Default for LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA {
17588 fn default() -> Self {
17589 Self::DEFAULT.clone()
17590 }
17591}
17592impl MessageData for LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA {
17593 type Message = MavMessage;
17594 const ID: u32 = 89u32;
17595 const NAME: &'static str = "LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET";
17596 const EXTRA_CRC: u8 = 231u8;
17597 const ENCODED_LEN: usize = 28usize;
17598 fn deser(
17599 _version: MavlinkVersion,
17600 __input: &[u8],
17601 ) -> Result<Self, ::mavlink_core::error::ParserError> {
17602 let avail_len = __input.len();
17603 let mut payload_buf = [0; Self::ENCODED_LEN];
17604 let mut buf = if avail_len < Self::ENCODED_LEN {
17605 payload_buf[0..avail_len].copy_from_slice(__input);
17606 Bytes::new(&payload_buf)
17607 } else {
17608 Bytes::new(__input)
17609 };
17610 let mut __struct = Self::default();
17611 __struct.time_boot_ms = buf.get_u32_le();
17612 __struct.x = buf.get_f32_le();
17613 __struct.y = buf.get_f32_le();
17614 __struct.z = buf.get_f32_le();
17615 __struct.roll = buf.get_f32_le();
17616 __struct.pitch = buf.get_f32_le();
17617 __struct.yaw = buf.get_f32_le();
17618 Ok(__struct)
17619 }
17620 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
17621 let mut __tmp = BytesMut::new(bytes);
17622 #[allow(clippy::absurd_extreme_comparisons)]
17623 #[allow(unused_comparisons)]
17624 if __tmp.remaining() < Self::ENCODED_LEN {
17625 panic!(
17626 "buffer is too small (need {} bytes, but got {})",
17627 Self::ENCODED_LEN,
17628 __tmp.remaining(),
17629 )
17630 }
17631 __tmp.put_u32_le(self.time_boot_ms);
17632 __tmp.put_f32_le(self.x);
17633 __tmp.put_f32_le(self.y);
17634 __tmp.put_f32_le(self.z);
17635 __tmp.put_f32_le(self.roll);
17636 __tmp.put_f32_le(self.pitch);
17637 __tmp.put_f32_le(self.yaw);
17638 if matches!(version, MavlinkVersion::V2) {
17639 let len = __tmp.len();
17640 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
17641 } else {
17642 __tmp.len()
17643 }
17644 }
17645}
17646#[doc = "An ack for a LOGGING_DATA_ACKED message."]
17647#[doc = ""]
17648#[doc = "ID: 268"]
17649#[derive(Debug, Clone, PartialEq)]
17650#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
17651#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
17652pub struct LOGGING_ACK_DATA {
17653 #[doc = "sequence number (must match the one in LOGGING_DATA_ACKED)"]
17654 pub sequence: u16,
17655 #[doc = "system ID of the target"]
17656 pub target_system: u8,
17657 #[doc = "component ID of the target"]
17658 pub target_component: u8,
17659}
17660impl LOGGING_ACK_DATA {
17661 pub const ENCODED_LEN: usize = 4usize;
17662 pub const DEFAULT: Self = Self {
17663 sequence: 0_u16,
17664 target_system: 0_u8,
17665 target_component: 0_u8,
17666 };
17667 #[cfg(feature = "arbitrary")]
17668 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
17669 use arbitrary::{Arbitrary, Unstructured};
17670 let mut buf = [0u8; 1024];
17671 rng.fill_bytes(&mut buf);
17672 let mut unstructured = Unstructured::new(&buf);
17673 Self::arbitrary(&mut unstructured).unwrap_or_default()
17674 }
17675}
17676impl Default for LOGGING_ACK_DATA {
17677 fn default() -> Self {
17678 Self::DEFAULT.clone()
17679 }
17680}
17681impl MessageData for LOGGING_ACK_DATA {
17682 type Message = MavMessage;
17683 const ID: u32 = 268u32;
17684 const NAME: &'static str = "LOGGING_ACK";
17685 const EXTRA_CRC: u8 = 14u8;
17686 const ENCODED_LEN: usize = 4usize;
17687 fn deser(
17688 _version: MavlinkVersion,
17689 __input: &[u8],
17690 ) -> Result<Self, ::mavlink_core::error::ParserError> {
17691 let avail_len = __input.len();
17692 let mut payload_buf = [0; Self::ENCODED_LEN];
17693 let mut buf = if avail_len < Self::ENCODED_LEN {
17694 payload_buf[0..avail_len].copy_from_slice(__input);
17695 Bytes::new(&payload_buf)
17696 } else {
17697 Bytes::new(__input)
17698 };
17699 let mut __struct = Self::default();
17700 __struct.sequence = buf.get_u16_le();
17701 __struct.target_system = buf.get_u8();
17702 __struct.target_component = buf.get_u8();
17703 Ok(__struct)
17704 }
17705 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
17706 let mut __tmp = BytesMut::new(bytes);
17707 #[allow(clippy::absurd_extreme_comparisons)]
17708 #[allow(unused_comparisons)]
17709 if __tmp.remaining() < Self::ENCODED_LEN {
17710 panic!(
17711 "buffer is too small (need {} bytes, but got {})",
17712 Self::ENCODED_LEN,
17713 __tmp.remaining(),
17714 )
17715 }
17716 __tmp.put_u16_le(self.sequence);
17717 __tmp.put_u8(self.target_system);
17718 __tmp.put_u8(self.target_component);
17719 if matches!(version, MavlinkVersion::V2) {
17720 let len = __tmp.len();
17721 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
17722 } else {
17723 __tmp.len()
17724 }
17725 }
17726}
17727#[doc = "A message containing logged data (see also MAV_CMD_LOGGING_START)."]
17728#[doc = ""]
17729#[doc = "ID: 266"]
17730#[derive(Debug, Clone, PartialEq)]
17731#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
17732#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
17733pub struct LOGGING_DATA_DATA {
17734 #[doc = "sequence number (can wrap)"]
17735 pub sequence: u16,
17736 #[doc = "system ID of the target"]
17737 pub target_system: u8,
17738 #[doc = "component ID of the target"]
17739 pub target_component: u8,
17740 #[doc = "data length"]
17741 pub length: u8,
17742 #[doc = "offset into data where first message starts. This can be used for recovery, when a previous message got lost (set to UINT8_MAX if no start exists)."]
17743 pub first_message_offset: u8,
17744 #[doc = "logged data"]
17745 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
17746 pub data: [u8; 249],
17747}
17748impl LOGGING_DATA_DATA {
17749 pub const ENCODED_LEN: usize = 255usize;
17750 pub const DEFAULT: Self = Self {
17751 sequence: 0_u16,
17752 target_system: 0_u8,
17753 target_component: 0_u8,
17754 length: 0_u8,
17755 first_message_offset: 0_u8,
17756 data: [0_u8; 249usize],
17757 };
17758 #[cfg(feature = "arbitrary")]
17759 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
17760 use arbitrary::{Arbitrary, Unstructured};
17761 let mut buf = [0u8; 1024];
17762 rng.fill_bytes(&mut buf);
17763 let mut unstructured = Unstructured::new(&buf);
17764 Self::arbitrary(&mut unstructured).unwrap_or_default()
17765 }
17766}
17767impl Default for LOGGING_DATA_DATA {
17768 fn default() -> Self {
17769 Self::DEFAULT.clone()
17770 }
17771}
17772impl MessageData for LOGGING_DATA_DATA {
17773 type Message = MavMessage;
17774 const ID: u32 = 266u32;
17775 const NAME: &'static str = "LOGGING_DATA";
17776 const EXTRA_CRC: u8 = 193u8;
17777 const ENCODED_LEN: usize = 255usize;
17778 fn deser(
17779 _version: MavlinkVersion,
17780 __input: &[u8],
17781 ) -> Result<Self, ::mavlink_core::error::ParserError> {
17782 let avail_len = __input.len();
17783 let mut payload_buf = [0; Self::ENCODED_LEN];
17784 let mut buf = if avail_len < Self::ENCODED_LEN {
17785 payload_buf[0..avail_len].copy_from_slice(__input);
17786 Bytes::new(&payload_buf)
17787 } else {
17788 Bytes::new(__input)
17789 };
17790 let mut __struct = Self::default();
17791 __struct.sequence = buf.get_u16_le();
17792 __struct.target_system = buf.get_u8();
17793 __struct.target_component = buf.get_u8();
17794 __struct.length = buf.get_u8();
17795 __struct.first_message_offset = buf.get_u8();
17796 for v in &mut __struct.data {
17797 let val = buf.get_u8();
17798 *v = val;
17799 }
17800 Ok(__struct)
17801 }
17802 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
17803 let mut __tmp = BytesMut::new(bytes);
17804 #[allow(clippy::absurd_extreme_comparisons)]
17805 #[allow(unused_comparisons)]
17806 if __tmp.remaining() < Self::ENCODED_LEN {
17807 panic!(
17808 "buffer is too small (need {} bytes, but got {})",
17809 Self::ENCODED_LEN,
17810 __tmp.remaining(),
17811 )
17812 }
17813 __tmp.put_u16_le(self.sequence);
17814 __tmp.put_u8(self.target_system);
17815 __tmp.put_u8(self.target_component);
17816 __tmp.put_u8(self.length);
17817 __tmp.put_u8(self.first_message_offset);
17818 for val in &self.data {
17819 __tmp.put_u8(*val);
17820 }
17821 if matches!(version, MavlinkVersion::V2) {
17822 let len = __tmp.len();
17823 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
17824 } else {
17825 __tmp.len()
17826 }
17827 }
17828}
17829#[doc = "A message containing logged data which requires a LOGGING_ACK to be sent back."]
17830#[doc = ""]
17831#[doc = "ID: 267"]
17832#[derive(Debug, Clone, PartialEq)]
17833#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
17834#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
17835pub struct LOGGING_DATA_ACKED_DATA {
17836 #[doc = "sequence number (can wrap)"]
17837 pub sequence: u16,
17838 #[doc = "system ID of the target"]
17839 pub target_system: u8,
17840 #[doc = "component ID of the target"]
17841 pub target_component: u8,
17842 #[doc = "data length"]
17843 pub length: u8,
17844 #[doc = "offset into data where first message starts. This can be used for recovery, when a previous message got lost (set to UINT8_MAX if no start exists)."]
17845 pub first_message_offset: u8,
17846 #[doc = "logged data"]
17847 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
17848 pub data: [u8; 249],
17849}
17850impl LOGGING_DATA_ACKED_DATA {
17851 pub const ENCODED_LEN: usize = 255usize;
17852 pub const DEFAULT: Self = Self {
17853 sequence: 0_u16,
17854 target_system: 0_u8,
17855 target_component: 0_u8,
17856 length: 0_u8,
17857 first_message_offset: 0_u8,
17858 data: [0_u8; 249usize],
17859 };
17860 #[cfg(feature = "arbitrary")]
17861 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
17862 use arbitrary::{Arbitrary, Unstructured};
17863 let mut buf = [0u8; 1024];
17864 rng.fill_bytes(&mut buf);
17865 let mut unstructured = Unstructured::new(&buf);
17866 Self::arbitrary(&mut unstructured).unwrap_or_default()
17867 }
17868}
17869impl Default for LOGGING_DATA_ACKED_DATA {
17870 fn default() -> Self {
17871 Self::DEFAULT.clone()
17872 }
17873}
17874impl MessageData for LOGGING_DATA_ACKED_DATA {
17875 type Message = MavMessage;
17876 const ID: u32 = 267u32;
17877 const NAME: &'static str = "LOGGING_DATA_ACKED";
17878 const EXTRA_CRC: u8 = 35u8;
17879 const ENCODED_LEN: usize = 255usize;
17880 fn deser(
17881 _version: MavlinkVersion,
17882 __input: &[u8],
17883 ) -> Result<Self, ::mavlink_core::error::ParserError> {
17884 let avail_len = __input.len();
17885 let mut payload_buf = [0; Self::ENCODED_LEN];
17886 let mut buf = if avail_len < Self::ENCODED_LEN {
17887 payload_buf[0..avail_len].copy_from_slice(__input);
17888 Bytes::new(&payload_buf)
17889 } else {
17890 Bytes::new(__input)
17891 };
17892 let mut __struct = Self::default();
17893 __struct.sequence = buf.get_u16_le();
17894 __struct.target_system = buf.get_u8();
17895 __struct.target_component = buf.get_u8();
17896 __struct.length = buf.get_u8();
17897 __struct.first_message_offset = buf.get_u8();
17898 for v in &mut __struct.data {
17899 let val = buf.get_u8();
17900 *v = val;
17901 }
17902 Ok(__struct)
17903 }
17904 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
17905 let mut __tmp = BytesMut::new(bytes);
17906 #[allow(clippy::absurd_extreme_comparisons)]
17907 #[allow(unused_comparisons)]
17908 if __tmp.remaining() < Self::ENCODED_LEN {
17909 panic!(
17910 "buffer is too small (need {} bytes, but got {})",
17911 Self::ENCODED_LEN,
17912 __tmp.remaining(),
17913 )
17914 }
17915 __tmp.put_u16_le(self.sequence);
17916 __tmp.put_u8(self.target_system);
17917 __tmp.put_u8(self.target_component);
17918 __tmp.put_u8(self.length);
17919 __tmp.put_u8(self.first_message_offset);
17920 for val in &self.data {
17921 __tmp.put_u8(*val);
17922 }
17923 if matches!(version, MavlinkVersion::V2) {
17924 let len = __tmp.len();
17925 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
17926 } else {
17927 __tmp.len()
17928 }
17929 }
17930}
17931#[doc = "Reply to LOG_REQUEST_DATA."]
17932#[doc = ""]
17933#[doc = "ID: 120"]
17934#[derive(Debug, Clone, PartialEq)]
17935#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
17936#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
17937pub struct LOG_DATA_DATA {
17938 #[doc = "Offset into the log"]
17939 pub ofs: u32,
17940 #[doc = "Log id (from LOG_ENTRY reply)"]
17941 pub id: u16,
17942 #[doc = "Number of bytes (zero for end of log)"]
17943 pub count: u8,
17944 #[doc = "log data"]
17945 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
17946 pub data: [u8; 90],
17947}
17948impl LOG_DATA_DATA {
17949 pub const ENCODED_LEN: usize = 97usize;
17950 pub const DEFAULT: Self = Self {
17951 ofs: 0_u32,
17952 id: 0_u16,
17953 count: 0_u8,
17954 data: [0_u8; 90usize],
17955 };
17956 #[cfg(feature = "arbitrary")]
17957 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
17958 use arbitrary::{Arbitrary, Unstructured};
17959 let mut buf = [0u8; 1024];
17960 rng.fill_bytes(&mut buf);
17961 let mut unstructured = Unstructured::new(&buf);
17962 Self::arbitrary(&mut unstructured).unwrap_or_default()
17963 }
17964}
17965impl Default for LOG_DATA_DATA {
17966 fn default() -> Self {
17967 Self::DEFAULT.clone()
17968 }
17969}
17970impl MessageData for LOG_DATA_DATA {
17971 type Message = MavMessage;
17972 const ID: u32 = 120u32;
17973 const NAME: &'static str = "LOG_DATA";
17974 const EXTRA_CRC: u8 = 134u8;
17975 const ENCODED_LEN: usize = 97usize;
17976 fn deser(
17977 _version: MavlinkVersion,
17978 __input: &[u8],
17979 ) -> Result<Self, ::mavlink_core::error::ParserError> {
17980 let avail_len = __input.len();
17981 let mut payload_buf = [0; Self::ENCODED_LEN];
17982 let mut buf = if avail_len < Self::ENCODED_LEN {
17983 payload_buf[0..avail_len].copy_from_slice(__input);
17984 Bytes::new(&payload_buf)
17985 } else {
17986 Bytes::new(__input)
17987 };
17988 let mut __struct = Self::default();
17989 __struct.ofs = buf.get_u32_le();
17990 __struct.id = buf.get_u16_le();
17991 __struct.count = buf.get_u8();
17992 for v in &mut __struct.data {
17993 let val = buf.get_u8();
17994 *v = val;
17995 }
17996 Ok(__struct)
17997 }
17998 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
17999 let mut __tmp = BytesMut::new(bytes);
18000 #[allow(clippy::absurd_extreme_comparisons)]
18001 #[allow(unused_comparisons)]
18002 if __tmp.remaining() < Self::ENCODED_LEN {
18003 panic!(
18004 "buffer is too small (need {} bytes, but got {})",
18005 Self::ENCODED_LEN,
18006 __tmp.remaining(),
18007 )
18008 }
18009 __tmp.put_u32_le(self.ofs);
18010 __tmp.put_u16_le(self.id);
18011 __tmp.put_u8(self.count);
18012 for val in &self.data {
18013 __tmp.put_u8(*val);
18014 }
18015 if matches!(version, MavlinkVersion::V2) {
18016 let len = __tmp.len();
18017 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
18018 } else {
18019 __tmp.len()
18020 }
18021 }
18022}
18023#[doc = "Reply to LOG_REQUEST_LIST."]
18024#[doc = ""]
18025#[doc = "ID: 118"]
18026#[derive(Debug, Clone, PartialEq)]
18027#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
18028#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
18029pub struct LOG_ENTRY_DATA {
18030 #[doc = "UTC timestamp of log since 1970, or 0 if not available"]
18031 pub time_utc: u32,
18032 #[doc = "Size of the log (may be approximate)"]
18033 pub size: u32,
18034 #[doc = "Log id"]
18035 pub id: u16,
18036 #[doc = "Total number of logs"]
18037 pub num_logs: u16,
18038 #[doc = "High log number"]
18039 pub last_log_num: u16,
18040}
18041impl LOG_ENTRY_DATA {
18042 pub const ENCODED_LEN: usize = 14usize;
18043 pub const DEFAULT: Self = Self {
18044 time_utc: 0_u32,
18045 size: 0_u32,
18046 id: 0_u16,
18047 num_logs: 0_u16,
18048 last_log_num: 0_u16,
18049 };
18050 #[cfg(feature = "arbitrary")]
18051 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
18052 use arbitrary::{Arbitrary, Unstructured};
18053 let mut buf = [0u8; 1024];
18054 rng.fill_bytes(&mut buf);
18055 let mut unstructured = Unstructured::new(&buf);
18056 Self::arbitrary(&mut unstructured).unwrap_or_default()
18057 }
18058}
18059impl Default for LOG_ENTRY_DATA {
18060 fn default() -> Self {
18061 Self::DEFAULT.clone()
18062 }
18063}
18064impl MessageData for LOG_ENTRY_DATA {
18065 type Message = MavMessage;
18066 const ID: u32 = 118u32;
18067 const NAME: &'static str = "LOG_ENTRY";
18068 const EXTRA_CRC: u8 = 56u8;
18069 const ENCODED_LEN: usize = 14usize;
18070 fn deser(
18071 _version: MavlinkVersion,
18072 __input: &[u8],
18073 ) -> Result<Self, ::mavlink_core::error::ParserError> {
18074 let avail_len = __input.len();
18075 let mut payload_buf = [0; Self::ENCODED_LEN];
18076 let mut buf = if avail_len < Self::ENCODED_LEN {
18077 payload_buf[0..avail_len].copy_from_slice(__input);
18078 Bytes::new(&payload_buf)
18079 } else {
18080 Bytes::new(__input)
18081 };
18082 let mut __struct = Self::default();
18083 __struct.time_utc = buf.get_u32_le();
18084 __struct.size = buf.get_u32_le();
18085 __struct.id = buf.get_u16_le();
18086 __struct.num_logs = buf.get_u16_le();
18087 __struct.last_log_num = buf.get_u16_le();
18088 Ok(__struct)
18089 }
18090 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
18091 let mut __tmp = BytesMut::new(bytes);
18092 #[allow(clippy::absurd_extreme_comparisons)]
18093 #[allow(unused_comparisons)]
18094 if __tmp.remaining() < Self::ENCODED_LEN {
18095 panic!(
18096 "buffer is too small (need {} bytes, but got {})",
18097 Self::ENCODED_LEN,
18098 __tmp.remaining(),
18099 )
18100 }
18101 __tmp.put_u32_le(self.time_utc);
18102 __tmp.put_u32_le(self.size);
18103 __tmp.put_u16_le(self.id);
18104 __tmp.put_u16_le(self.num_logs);
18105 __tmp.put_u16_le(self.last_log_num);
18106 if matches!(version, MavlinkVersion::V2) {
18107 let len = __tmp.len();
18108 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
18109 } else {
18110 __tmp.len()
18111 }
18112 }
18113}
18114#[doc = "Erase all logs."]
18115#[doc = ""]
18116#[doc = "ID: 121"]
18117#[derive(Debug, Clone, PartialEq)]
18118#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
18119#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
18120pub struct LOG_ERASE_DATA {
18121 #[doc = "System ID"]
18122 pub target_system: u8,
18123 #[doc = "Component ID"]
18124 pub target_component: u8,
18125}
18126impl LOG_ERASE_DATA {
18127 pub const ENCODED_LEN: usize = 2usize;
18128 pub const DEFAULT: Self = Self {
18129 target_system: 0_u8,
18130 target_component: 0_u8,
18131 };
18132 #[cfg(feature = "arbitrary")]
18133 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
18134 use arbitrary::{Arbitrary, Unstructured};
18135 let mut buf = [0u8; 1024];
18136 rng.fill_bytes(&mut buf);
18137 let mut unstructured = Unstructured::new(&buf);
18138 Self::arbitrary(&mut unstructured).unwrap_or_default()
18139 }
18140}
18141impl Default for LOG_ERASE_DATA {
18142 fn default() -> Self {
18143 Self::DEFAULT.clone()
18144 }
18145}
18146impl MessageData for LOG_ERASE_DATA {
18147 type Message = MavMessage;
18148 const ID: u32 = 121u32;
18149 const NAME: &'static str = "LOG_ERASE";
18150 const EXTRA_CRC: u8 = 237u8;
18151 const ENCODED_LEN: usize = 2usize;
18152 fn deser(
18153 _version: MavlinkVersion,
18154 __input: &[u8],
18155 ) -> Result<Self, ::mavlink_core::error::ParserError> {
18156 let avail_len = __input.len();
18157 let mut payload_buf = [0; Self::ENCODED_LEN];
18158 let mut buf = if avail_len < Self::ENCODED_LEN {
18159 payload_buf[0..avail_len].copy_from_slice(__input);
18160 Bytes::new(&payload_buf)
18161 } else {
18162 Bytes::new(__input)
18163 };
18164 let mut __struct = Self::default();
18165 __struct.target_system = buf.get_u8();
18166 __struct.target_component = buf.get_u8();
18167 Ok(__struct)
18168 }
18169 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
18170 let mut __tmp = BytesMut::new(bytes);
18171 #[allow(clippy::absurd_extreme_comparisons)]
18172 #[allow(unused_comparisons)]
18173 if __tmp.remaining() < Self::ENCODED_LEN {
18174 panic!(
18175 "buffer is too small (need {} bytes, but got {})",
18176 Self::ENCODED_LEN,
18177 __tmp.remaining(),
18178 )
18179 }
18180 __tmp.put_u8(self.target_system);
18181 __tmp.put_u8(self.target_component);
18182 if matches!(version, MavlinkVersion::V2) {
18183 let len = __tmp.len();
18184 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
18185 } else {
18186 __tmp.len()
18187 }
18188 }
18189}
18190#[doc = "Request a chunk of a log."]
18191#[doc = ""]
18192#[doc = "ID: 119"]
18193#[derive(Debug, Clone, PartialEq)]
18194#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
18195#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
18196pub struct LOG_REQUEST_DATA_DATA {
18197 #[doc = "Offset into the log"]
18198 pub ofs: u32,
18199 #[doc = "Number of bytes"]
18200 pub count: u32,
18201 #[doc = "Log id (from LOG_ENTRY reply)"]
18202 pub id: u16,
18203 #[doc = "System ID"]
18204 pub target_system: u8,
18205 #[doc = "Component ID"]
18206 pub target_component: u8,
18207}
18208impl LOG_REQUEST_DATA_DATA {
18209 pub const ENCODED_LEN: usize = 12usize;
18210 pub const DEFAULT: Self = Self {
18211 ofs: 0_u32,
18212 count: 0_u32,
18213 id: 0_u16,
18214 target_system: 0_u8,
18215 target_component: 0_u8,
18216 };
18217 #[cfg(feature = "arbitrary")]
18218 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
18219 use arbitrary::{Arbitrary, Unstructured};
18220 let mut buf = [0u8; 1024];
18221 rng.fill_bytes(&mut buf);
18222 let mut unstructured = Unstructured::new(&buf);
18223 Self::arbitrary(&mut unstructured).unwrap_or_default()
18224 }
18225}
18226impl Default for LOG_REQUEST_DATA_DATA {
18227 fn default() -> Self {
18228 Self::DEFAULT.clone()
18229 }
18230}
18231impl MessageData for LOG_REQUEST_DATA_DATA {
18232 type Message = MavMessage;
18233 const ID: u32 = 119u32;
18234 const NAME: &'static str = "LOG_REQUEST_DATA";
18235 const EXTRA_CRC: u8 = 116u8;
18236 const ENCODED_LEN: usize = 12usize;
18237 fn deser(
18238 _version: MavlinkVersion,
18239 __input: &[u8],
18240 ) -> Result<Self, ::mavlink_core::error::ParserError> {
18241 let avail_len = __input.len();
18242 let mut payload_buf = [0; Self::ENCODED_LEN];
18243 let mut buf = if avail_len < Self::ENCODED_LEN {
18244 payload_buf[0..avail_len].copy_from_slice(__input);
18245 Bytes::new(&payload_buf)
18246 } else {
18247 Bytes::new(__input)
18248 };
18249 let mut __struct = Self::default();
18250 __struct.ofs = buf.get_u32_le();
18251 __struct.count = buf.get_u32_le();
18252 __struct.id = buf.get_u16_le();
18253 __struct.target_system = buf.get_u8();
18254 __struct.target_component = buf.get_u8();
18255 Ok(__struct)
18256 }
18257 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
18258 let mut __tmp = BytesMut::new(bytes);
18259 #[allow(clippy::absurd_extreme_comparisons)]
18260 #[allow(unused_comparisons)]
18261 if __tmp.remaining() < Self::ENCODED_LEN {
18262 panic!(
18263 "buffer is too small (need {} bytes, but got {})",
18264 Self::ENCODED_LEN,
18265 __tmp.remaining(),
18266 )
18267 }
18268 __tmp.put_u32_le(self.ofs);
18269 __tmp.put_u32_le(self.count);
18270 __tmp.put_u16_le(self.id);
18271 __tmp.put_u8(self.target_system);
18272 __tmp.put_u8(self.target_component);
18273 if matches!(version, MavlinkVersion::V2) {
18274 let len = __tmp.len();
18275 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
18276 } else {
18277 __tmp.len()
18278 }
18279 }
18280}
18281#[doc = "Stop log transfer and resume normal logging."]
18282#[doc = ""]
18283#[doc = "ID: 122"]
18284#[derive(Debug, Clone, PartialEq)]
18285#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
18286#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
18287pub struct LOG_REQUEST_END_DATA {
18288 #[doc = "System ID"]
18289 pub target_system: u8,
18290 #[doc = "Component ID"]
18291 pub target_component: u8,
18292}
18293impl LOG_REQUEST_END_DATA {
18294 pub const ENCODED_LEN: usize = 2usize;
18295 pub const DEFAULT: Self = Self {
18296 target_system: 0_u8,
18297 target_component: 0_u8,
18298 };
18299 #[cfg(feature = "arbitrary")]
18300 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
18301 use arbitrary::{Arbitrary, Unstructured};
18302 let mut buf = [0u8; 1024];
18303 rng.fill_bytes(&mut buf);
18304 let mut unstructured = Unstructured::new(&buf);
18305 Self::arbitrary(&mut unstructured).unwrap_or_default()
18306 }
18307}
18308impl Default for LOG_REQUEST_END_DATA {
18309 fn default() -> Self {
18310 Self::DEFAULT.clone()
18311 }
18312}
18313impl MessageData for LOG_REQUEST_END_DATA {
18314 type Message = MavMessage;
18315 const ID: u32 = 122u32;
18316 const NAME: &'static str = "LOG_REQUEST_END";
18317 const EXTRA_CRC: u8 = 203u8;
18318 const ENCODED_LEN: usize = 2usize;
18319 fn deser(
18320 _version: MavlinkVersion,
18321 __input: &[u8],
18322 ) -> Result<Self, ::mavlink_core::error::ParserError> {
18323 let avail_len = __input.len();
18324 let mut payload_buf = [0; Self::ENCODED_LEN];
18325 let mut buf = if avail_len < Self::ENCODED_LEN {
18326 payload_buf[0..avail_len].copy_from_slice(__input);
18327 Bytes::new(&payload_buf)
18328 } else {
18329 Bytes::new(__input)
18330 };
18331 let mut __struct = Self::default();
18332 __struct.target_system = buf.get_u8();
18333 __struct.target_component = buf.get_u8();
18334 Ok(__struct)
18335 }
18336 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
18337 let mut __tmp = BytesMut::new(bytes);
18338 #[allow(clippy::absurd_extreme_comparisons)]
18339 #[allow(unused_comparisons)]
18340 if __tmp.remaining() < Self::ENCODED_LEN {
18341 panic!(
18342 "buffer is too small (need {} bytes, but got {})",
18343 Self::ENCODED_LEN,
18344 __tmp.remaining(),
18345 )
18346 }
18347 __tmp.put_u8(self.target_system);
18348 __tmp.put_u8(self.target_component);
18349 if matches!(version, MavlinkVersion::V2) {
18350 let len = __tmp.len();
18351 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
18352 } else {
18353 __tmp.len()
18354 }
18355 }
18356}
18357#[doc = "Request a list of available logs. On some systems calling this may stop on-board logging until LOG_REQUEST_END is called. If there are no log files available this request shall be answered with one LOG_ENTRY message with id = 0 and num_logs = 0."]
18358#[doc = ""]
18359#[doc = "ID: 117"]
18360#[derive(Debug, Clone, PartialEq)]
18361#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
18362#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
18363pub struct LOG_REQUEST_LIST_DATA {
18364 #[doc = "First log id (0 for first available)"]
18365 pub start: u16,
18366 #[doc = "Last log id (0xffff for last available)"]
18367 pub end: u16,
18368 #[doc = "System ID"]
18369 pub target_system: u8,
18370 #[doc = "Component ID"]
18371 pub target_component: u8,
18372}
18373impl LOG_REQUEST_LIST_DATA {
18374 pub const ENCODED_LEN: usize = 6usize;
18375 pub const DEFAULT: Self = Self {
18376 start: 0_u16,
18377 end: 0_u16,
18378 target_system: 0_u8,
18379 target_component: 0_u8,
18380 };
18381 #[cfg(feature = "arbitrary")]
18382 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
18383 use arbitrary::{Arbitrary, Unstructured};
18384 let mut buf = [0u8; 1024];
18385 rng.fill_bytes(&mut buf);
18386 let mut unstructured = Unstructured::new(&buf);
18387 Self::arbitrary(&mut unstructured).unwrap_or_default()
18388 }
18389}
18390impl Default for LOG_REQUEST_LIST_DATA {
18391 fn default() -> Self {
18392 Self::DEFAULT.clone()
18393 }
18394}
18395impl MessageData for LOG_REQUEST_LIST_DATA {
18396 type Message = MavMessage;
18397 const ID: u32 = 117u32;
18398 const NAME: &'static str = "LOG_REQUEST_LIST";
18399 const EXTRA_CRC: u8 = 128u8;
18400 const ENCODED_LEN: usize = 6usize;
18401 fn deser(
18402 _version: MavlinkVersion,
18403 __input: &[u8],
18404 ) -> Result<Self, ::mavlink_core::error::ParserError> {
18405 let avail_len = __input.len();
18406 let mut payload_buf = [0; Self::ENCODED_LEN];
18407 let mut buf = if avail_len < Self::ENCODED_LEN {
18408 payload_buf[0..avail_len].copy_from_slice(__input);
18409 Bytes::new(&payload_buf)
18410 } else {
18411 Bytes::new(__input)
18412 };
18413 let mut __struct = Self::default();
18414 __struct.start = buf.get_u16_le();
18415 __struct.end = buf.get_u16_le();
18416 __struct.target_system = buf.get_u8();
18417 __struct.target_component = buf.get_u8();
18418 Ok(__struct)
18419 }
18420 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
18421 let mut __tmp = BytesMut::new(bytes);
18422 #[allow(clippy::absurd_extreme_comparisons)]
18423 #[allow(unused_comparisons)]
18424 if __tmp.remaining() < Self::ENCODED_LEN {
18425 panic!(
18426 "buffer is too small (need {} bytes, but got {})",
18427 Self::ENCODED_LEN,
18428 __tmp.remaining(),
18429 )
18430 }
18431 __tmp.put_u16_le(self.start);
18432 __tmp.put_u16_le(self.end);
18433 __tmp.put_u8(self.target_system);
18434 __tmp.put_u8(self.target_component);
18435 if matches!(version, MavlinkVersion::V2) {
18436 let len = __tmp.len();
18437 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
18438 } else {
18439 __tmp.len()
18440 }
18441 }
18442}
18443#[doc = "Reports results of completed compass calibration. Sent until MAG_CAL_ACK received."]
18444#[doc = ""]
18445#[doc = "ID: 192"]
18446#[derive(Debug, Clone, PartialEq)]
18447#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
18448#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
18449pub struct MAG_CAL_REPORT_DATA {
18450 #[doc = "RMS milligauss residuals."]
18451 pub fitness: f32,
18452 #[doc = "X offset."]
18453 pub ofs_x: f32,
18454 #[doc = "Y offset."]
18455 pub ofs_y: f32,
18456 #[doc = "Z offset."]
18457 pub ofs_z: f32,
18458 #[doc = "X diagonal (matrix 11)."]
18459 pub diag_x: f32,
18460 #[doc = "Y diagonal (matrix 22)."]
18461 pub diag_y: f32,
18462 #[doc = "Z diagonal (matrix 33)."]
18463 pub diag_z: f32,
18464 #[doc = "X off-diagonal (matrix 12 and 21)."]
18465 pub offdiag_x: f32,
18466 #[doc = "Y off-diagonal (matrix 13 and 31)."]
18467 pub offdiag_y: f32,
18468 #[doc = "Z off-diagonal (matrix 32 and 23)."]
18469 pub offdiag_z: f32,
18470 #[doc = "Compass being calibrated."]
18471 pub compass_id: u8,
18472 #[doc = "Bitmask of compasses being calibrated."]
18473 pub cal_mask: u8,
18474 #[doc = "Calibration Status."]
18475 pub cal_status: MagCalStatus,
18476 #[doc = "0=requires a MAV_CMD_DO_ACCEPT_MAG_CAL, 1=saved to parameters."]
18477 pub autosaved: u8,
18478 #[doc = "Confidence in orientation (higher is better)."]
18479 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
18480 pub orientation_confidence: f32,
18481 #[doc = "orientation before calibration."]
18482 #[cfg_attr(feature = "serde", serde(default))]
18483 pub old_orientation: MavSensorOrientation,
18484 #[doc = "orientation after calibration."]
18485 #[cfg_attr(feature = "serde", serde(default))]
18486 pub new_orientation: MavSensorOrientation,
18487 #[doc = "field radius correction factor"]
18488 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
18489 pub scale_factor: f32,
18490}
18491impl MAG_CAL_REPORT_DATA {
18492 pub const ENCODED_LEN: usize = 54usize;
18493 pub const DEFAULT: Self = Self {
18494 fitness: 0.0_f32,
18495 ofs_x: 0.0_f32,
18496 ofs_y: 0.0_f32,
18497 ofs_z: 0.0_f32,
18498 diag_x: 0.0_f32,
18499 diag_y: 0.0_f32,
18500 diag_z: 0.0_f32,
18501 offdiag_x: 0.0_f32,
18502 offdiag_y: 0.0_f32,
18503 offdiag_z: 0.0_f32,
18504 compass_id: 0_u8,
18505 cal_mask: 0_u8,
18506 cal_status: MagCalStatus::DEFAULT,
18507 autosaved: 0_u8,
18508 orientation_confidence: 0.0_f32,
18509 old_orientation: MavSensorOrientation::DEFAULT,
18510 new_orientation: MavSensorOrientation::DEFAULT,
18511 scale_factor: 0.0_f32,
18512 };
18513 #[cfg(feature = "arbitrary")]
18514 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
18515 use arbitrary::{Arbitrary, Unstructured};
18516 let mut buf = [0u8; 1024];
18517 rng.fill_bytes(&mut buf);
18518 let mut unstructured = Unstructured::new(&buf);
18519 Self::arbitrary(&mut unstructured).unwrap_or_default()
18520 }
18521}
18522impl Default for MAG_CAL_REPORT_DATA {
18523 fn default() -> Self {
18524 Self::DEFAULT.clone()
18525 }
18526}
18527impl MessageData for MAG_CAL_REPORT_DATA {
18528 type Message = MavMessage;
18529 const ID: u32 = 192u32;
18530 const NAME: &'static str = "MAG_CAL_REPORT";
18531 const EXTRA_CRC: u8 = 36u8;
18532 const ENCODED_LEN: usize = 54usize;
18533 fn deser(
18534 _version: MavlinkVersion,
18535 __input: &[u8],
18536 ) -> Result<Self, ::mavlink_core::error::ParserError> {
18537 let avail_len = __input.len();
18538 let mut payload_buf = [0; Self::ENCODED_LEN];
18539 let mut buf = if avail_len < Self::ENCODED_LEN {
18540 payload_buf[0..avail_len].copy_from_slice(__input);
18541 Bytes::new(&payload_buf)
18542 } else {
18543 Bytes::new(__input)
18544 };
18545 let mut __struct = Self::default();
18546 __struct.fitness = buf.get_f32_le();
18547 __struct.ofs_x = buf.get_f32_le();
18548 __struct.ofs_y = buf.get_f32_le();
18549 __struct.ofs_z = buf.get_f32_le();
18550 __struct.diag_x = buf.get_f32_le();
18551 __struct.diag_y = buf.get_f32_le();
18552 __struct.diag_z = buf.get_f32_le();
18553 __struct.offdiag_x = buf.get_f32_le();
18554 __struct.offdiag_y = buf.get_f32_le();
18555 __struct.offdiag_z = buf.get_f32_le();
18556 __struct.compass_id = buf.get_u8();
18557 __struct.cal_mask = buf.get_u8();
18558 let tmp = buf.get_u8();
18559 __struct.cal_status =
18560 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
18561 enum_type: "MagCalStatus",
18562 value: tmp as u32,
18563 })?;
18564 __struct.autosaved = buf.get_u8();
18565 __struct.orientation_confidence = buf.get_f32_le();
18566 let tmp = buf.get_u8();
18567 __struct.old_orientation =
18568 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
18569 enum_type: "MavSensorOrientation",
18570 value: tmp as u32,
18571 })?;
18572 let tmp = buf.get_u8();
18573 __struct.new_orientation =
18574 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
18575 enum_type: "MavSensorOrientation",
18576 value: tmp as u32,
18577 })?;
18578 __struct.scale_factor = buf.get_f32_le();
18579 Ok(__struct)
18580 }
18581 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
18582 let mut __tmp = BytesMut::new(bytes);
18583 #[allow(clippy::absurd_extreme_comparisons)]
18584 #[allow(unused_comparisons)]
18585 if __tmp.remaining() < Self::ENCODED_LEN {
18586 panic!(
18587 "buffer is too small (need {} bytes, but got {})",
18588 Self::ENCODED_LEN,
18589 __tmp.remaining(),
18590 )
18591 }
18592 __tmp.put_f32_le(self.fitness);
18593 __tmp.put_f32_le(self.ofs_x);
18594 __tmp.put_f32_le(self.ofs_y);
18595 __tmp.put_f32_le(self.ofs_z);
18596 __tmp.put_f32_le(self.diag_x);
18597 __tmp.put_f32_le(self.diag_y);
18598 __tmp.put_f32_le(self.diag_z);
18599 __tmp.put_f32_le(self.offdiag_x);
18600 __tmp.put_f32_le(self.offdiag_y);
18601 __tmp.put_f32_le(self.offdiag_z);
18602 __tmp.put_u8(self.compass_id);
18603 __tmp.put_u8(self.cal_mask);
18604 __tmp.put_u8(self.cal_status as u8);
18605 __tmp.put_u8(self.autosaved);
18606 if matches!(version, MavlinkVersion::V2) {
18607 __tmp.put_f32_le(self.orientation_confidence);
18608 __tmp.put_u8(self.old_orientation as u8);
18609 __tmp.put_u8(self.new_orientation as u8);
18610 __tmp.put_f32_le(self.scale_factor);
18611 let len = __tmp.len();
18612 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
18613 } else {
18614 __tmp.len()
18615 }
18616 }
18617}
18618#[doc = "This message provides an API for manually controlling the vehicle using standard joystick axes nomenclature, along with a joystick-like input device. Unused axes can be disabled and buttons states are transmitted as individual on/off bits of a bitmask."]
18619#[doc = ""]
18620#[doc = "ID: 69"]
18621#[derive(Debug, Clone, PartialEq)]
18622#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
18623#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
18624pub struct MANUAL_CONTROL_DATA {
18625 #[doc = "X-axis, normalized to the range [-1000,1000]. A value of INT16_MAX indicates that this axis is invalid. Generally corresponds to forward(1000)-backward(-1000) movement on a joystick and the pitch of a vehicle."]
18626 pub x: i16,
18627 #[doc = "Y-axis, normalized to the range [-1000,1000]. A value of INT16_MAX indicates that this axis is invalid. Generally corresponds to left(-1000)-right(1000) movement on a joystick and the roll of a vehicle."]
18628 pub y: i16,
18629 #[doc = "Z-axis, normalized to the range [-1000,1000]. A value of INT16_MAX indicates that this axis is invalid. Generally corresponds to a separate slider movement with maximum being 1000 and minimum being -1000 on a joystick and the thrust of a vehicle. Positive values are positive thrust, negative values are negative thrust."]
18630 pub z: i16,
18631 #[doc = "R-axis, normalized to the range [-1000,1000]. A value of INT16_MAX indicates that this axis is invalid. Generally corresponds to a twisting of the joystick, with counter-clockwise being 1000 and clockwise being -1000, and the yaw of a vehicle."]
18632 pub r: i16,
18633 #[doc = "A bitfield corresponding to the joystick buttons' 0-15 current state, 1 for pressed, 0 for released. The lowest bit corresponds to Button 1."]
18634 pub buttons: u16,
18635 #[doc = "The system to be controlled."]
18636 pub target: u8,
18637 #[doc = "A bitfield corresponding to the joystick buttons' 16-31 current state, 1 for pressed, 0 for released. The lowest bit corresponds to Button 16."]
18638 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
18639 pub buttons2: u16,
18640 #[doc = "Set bits to 1 to indicate which of the following extension fields contain valid data: bit 0: pitch, bit 1: roll, bit 2: aux1, bit 3: aux2, bit 4: aux3, bit 5: aux4, bit 6: aux5, bit 7: aux6"]
18641 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
18642 pub enabled_extensions: u8,
18643 #[doc = "Pitch-only-axis, normalized to the range [-1000,1000]. Generally corresponds to pitch on vehicles with additional degrees of freedom. Valid if bit 0 of enabled_extensions field is set. Set to 0 if invalid."]
18644 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
18645 pub s: i16,
18646 #[doc = "Roll-only-axis, normalized to the range [-1000,1000]. Generally corresponds to roll on vehicles with additional degrees of freedom. Valid if bit 1 of enabled_extensions field is set. Set to 0 if invalid."]
18647 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
18648 pub t: i16,
18649 #[doc = "Aux continuous input field 1. Normalized in the range [-1000,1000]. Purpose defined by recipient. Valid data if bit 2 of enabled_extensions field is set. 0 if bit 2 is unset."]
18650 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
18651 pub aux1: i16,
18652 #[doc = "Aux continuous input field 2. Normalized in the range [-1000,1000]. Purpose defined by recipient. Valid data if bit 3 of enabled_extensions field is set. 0 if bit 3 is unset."]
18653 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
18654 pub aux2: i16,
18655 #[doc = "Aux continuous input field 3. Normalized in the range [-1000,1000]. Purpose defined by recipient. Valid data if bit 4 of enabled_extensions field is set. 0 if bit 4 is unset."]
18656 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
18657 pub aux3: i16,
18658 #[doc = "Aux continuous input field 4. Normalized in the range [-1000,1000]. Purpose defined by recipient. Valid data if bit 5 of enabled_extensions field is set. 0 if bit 5 is unset."]
18659 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
18660 pub aux4: i16,
18661 #[doc = "Aux continuous input field 5. Normalized in the range [-1000,1000]. Purpose defined by recipient. Valid data if bit 6 of enabled_extensions field is set. 0 if bit 6 is unset."]
18662 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
18663 pub aux5: i16,
18664 #[doc = "Aux continuous input field 6. Normalized in the range [-1000,1000]. Purpose defined by recipient. Valid data if bit 7 of enabled_extensions field is set. 0 if bit 7 is unset."]
18665 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
18666 pub aux6: i16,
18667}
18668impl MANUAL_CONTROL_DATA {
18669 pub const ENCODED_LEN: usize = 30usize;
18670 pub const DEFAULT: Self = Self {
18671 x: 0_i16,
18672 y: 0_i16,
18673 z: 0_i16,
18674 r: 0_i16,
18675 buttons: 0_u16,
18676 target: 0_u8,
18677 buttons2: 0_u16,
18678 enabled_extensions: 0_u8,
18679 s: 0_i16,
18680 t: 0_i16,
18681 aux1: 0_i16,
18682 aux2: 0_i16,
18683 aux3: 0_i16,
18684 aux4: 0_i16,
18685 aux5: 0_i16,
18686 aux6: 0_i16,
18687 };
18688 #[cfg(feature = "arbitrary")]
18689 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
18690 use arbitrary::{Arbitrary, Unstructured};
18691 let mut buf = [0u8; 1024];
18692 rng.fill_bytes(&mut buf);
18693 let mut unstructured = Unstructured::new(&buf);
18694 Self::arbitrary(&mut unstructured).unwrap_or_default()
18695 }
18696}
18697impl Default for MANUAL_CONTROL_DATA {
18698 fn default() -> Self {
18699 Self::DEFAULT.clone()
18700 }
18701}
18702impl MessageData for MANUAL_CONTROL_DATA {
18703 type Message = MavMessage;
18704 const ID: u32 = 69u32;
18705 const NAME: &'static str = "MANUAL_CONTROL";
18706 const EXTRA_CRC: u8 = 243u8;
18707 const ENCODED_LEN: usize = 30usize;
18708 fn deser(
18709 _version: MavlinkVersion,
18710 __input: &[u8],
18711 ) -> Result<Self, ::mavlink_core::error::ParserError> {
18712 let avail_len = __input.len();
18713 let mut payload_buf = [0; Self::ENCODED_LEN];
18714 let mut buf = if avail_len < Self::ENCODED_LEN {
18715 payload_buf[0..avail_len].copy_from_slice(__input);
18716 Bytes::new(&payload_buf)
18717 } else {
18718 Bytes::new(__input)
18719 };
18720 let mut __struct = Self::default();
18721 __struct.x = buf.get_i16_le();
18722 __struct.y = buf.get_i16_le();
18723 __struct.z = buf.get_i16_le();
18724 __struct.r = buf.get_i16_le();
18725 __struct.buttons = buf.get_u16_le();
18726 __struct.target = buf.get_u8();
18727 __struct.buttons2 = buf.get_u16_le();
18728 __struct.enabled_extensions = buf.get_u8();
18729 __struct.s = buf.get_i16_le();
18730 __struct.t = buf.get_i16_le();
18731 __struct.aux1 = buf.get_i16_le();
18732 __struct.aux2 = buf.get_i16_le();
18733 __struct.aux3 = buf.get_i16_le();
18734 __struct.aux4 = buf.get_i16_le();
18735 __struct.aux5 = buf.get_i16_le();
18736 __struct.aux6 = buf.get_i16_le();
18737 Ok(__struct)
18738 }
18739 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
18740 let mut __tmp = BytesMut::new(bytes);
18741 #[allow(clippy::absurd_extreme_comparisons)]
18742 #[allow(unused_comparisons)]
18743 if __tmp.remaining() < Self::ENCODED_LEN {
18744 panic!(
18745 "buffer is too small (need {} bytes, but got {})",
18746 Self::ENCODED_LEN,
18747 __tmp.remaining(),
18748 )
18749 }
18750 __tmp.put_i16_le(self.x);
18751 __tmp.put_i16_le(self.y);
18752 __tmp.put_i16_le(self.z);
18753 __tmp.put_i16_le(self.r);
18754 __tmp.put_u16_le(self.buttons);
18755 __tmp.put_u8(self.target);
18756 if matches!(version, MavlinkVersion::V2) {
18757 __tmp.put_u16_le(self.buttons2);
18758 __tmp.put_u8(self.enabled_extensions);
18759 __tmp.put_i16_le(self.s);
18760 __tmp.put_i16_le(self.t);
18761 __tmp.put_i16_le(self.aux1);
18762 __tmp.put_i16_le(self.aux2);
18763 __tmp.put_i16_le(self.aux3);
18764 __tmp.put_i16_le(self.aux4);
18765 __tmp.put_i16_le(self.aux5);
18766 __tmp.put_i16_le(self.aux6);
18767 let len = __tmp.len();
18768 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
18769 } else {
18770 __tmp.len()
18771 }
18772 }
18773}
18774#[doc = "Setpoint in roll, pitch, yaw and thrust from the operator."]
18775#[doc = ""]
18776#[doc = "ID: 81"]
18777#[derive(Debug, Clone, PartialEq)]
18778#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
18779#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
18780pub struct MANUAL_SETPOINT_DATA {
18781 #[doc = "Timestamp (time since system boot)."]
18782 pub time_boot_ms: u32,
18783 #[doc = "Desired roll rate"]
18784 pub roll: f32,
18785 #[doc = "Desired pitch rate"]
18786 pub pitch: f32,
18787 #[doc = "Desired yaw rate"]
18788 pub yaw: f32,
18789 #[doc = "Collective thrust, normalized to 0 .. 1"]
18790 pub thrust: f32,
18791 #[doc = "Flight mode switch position, 0.. 255"]
18792 pub mode_switch: u8,
18793 #[doc = "Override mode switch position, 0.. 255"]
18794 pub manual_override_switch: u8,
18795}
18796impl MANUAL_SETPOINT_DATA {
18797 pub const ENCODED_LEN: usize = 22usize;
18798 pub const DEFAULT: Self = Self {
18799 time_boot_ms: 0_u32,
18800 roll: 0.0_f32,
18801 pitch: 0.0_f32,
18802 yaw: 0.0_f32,
18803 thrust: 0.0_f32,
18804 mode_switch: 0_u8,
18805 manual_override_switch: 0_u8,
18806 };
18807 #[cfg(feature = "arbitrary")]
18808 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
18809 use arbitrary::{Arbitrary, Unstructured};
18810 let mut buf = [0u8; 1024];
18811 rng.fill_bytes(&mut buf);
18812 let mut unstructured = Unstructured::new(&buf);
18813 Self::arbitrary(&mut unstructured).unwrap_or_default()
18814 }
18815}
18816impl Default for MANUAL_SETPOINT_DATA {
18817 fn default() -> Self {
18818 Self::DEFAULT.clone()
18819 }
18820}
18821impl MessageData for MANUAL_SETPOINT_DATA {
18822 type Message = MavMessage;
18823 const ID: u32 = 81u32;
18824 const NAME: &'static str = "MANUAL_SETPOINT";
18825 const EXTRA_CRC: u8 = 106u8;
18826 const ENCODED_LEN: usize = 22usize;
18827 fn deser(
18828 _version: MavlinkVersion,
18829 __input: &[u8],
18830 ) -> Result<Self, ::mavlink_core::error::ParserError> {
18831 let avail_len = __input.len();
18832 let mut payload_buf = [0; Self::ENCODED_LEN];
18833 let mut buf = if avail_len < Self::ENCODED_LEN {
18834 payload_buf[0..avail_len].copy_from_slice(__input);
18835 Bytes::new(&payload_buf)
18836 } else {
18837 Bytes::new(__input)
18838 };
18839 let mut __struct = Self::default();
18840 __struct.time_boot_ms = buf.get_u32_le();
18841 __struct.roll = buf.get_f32_le();
18842 __struct.pitch = buf.get_f32_le();
18843 __struct.yaw = buf.get_f32_le();
18844 __struct.thrust = buf.get_f32_le();
18845 __struct.mode_switch = buf.get_u8();
18846 __struct.manual_override_switch = buf.get_u8();
18847 Ok(__struct)
18848 }
18849 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
18850 let mut __tmp = BytesMut::new(bytes);
18851 #[allow(clippy::absurd_extreme_comparisons)]
18852 #[allow(unused_comparisons)]
18853 if __tmp.remaining() < Self::ENCODED_LEN {
18854 panic!(
18855 "buffer is too small (need {} bytes, but got {})",
18856 Self::ENCODED_LEN,
18857 __tmp.remaining(),
18858 )
18859 }
18860 __tmp.put_u32_le(self.time_boot_ms);
18861 __tmp.put_f32_le(self.roll);
18862 __tmp.put_f32_le(self.pitch);
18863 __tmp.put_f32_le(self.yaw);
18864 __tmp.put_f32_le(self.thrust);
18865 __tmp.put_u8(self.mode_switch);
18866 __tmp.put_u8(self.manual_override_switch);
18867 if matches!(version, MavlinkVersion::V2) {
18868 let len = __tmp.len();
18869 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
18870 } else {
18871 __tmp.len()
18872 }
18873 }
18874}
18875#[doc = "Send raw controller memory. The use of this message is discouraged for normal packets, but a quite efficient way for testing new messages and getting experimental debug output."]
18876#[doc = ""]
18877#[doc = "ID: 249"]
18878#[derive(Debug, Clone, PartialEq)]
18879#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
18880#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
18881pub struct MEMORY_VECT_DATA {
18882 #[doc = "Starting address of the debug variables"]
18883 pub address: u16,
18884 #[doc = "Version code of the type variable. 0=unknown, type ignored and assumed int16_t. 1=as below"]
18885 pub ver: u8,
18886 #[doc = "Type code of the memory variables. for ver = 1: 0=16 x int16_t, 1=16 x uint16_t, 2=16 x Q15, 3=16 x 1Q14"]
18887 pub mavtype: u8,
18888 #[doc = "Memory contents at specified address"]
18889 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
18890 pub value: [i8; 32],
18891}
18892impl MEMORY_VECT_DATA {
18893 pub const ENCODED_LEN: usize = 36usize;
18894 pub const DEFAULT: Self = Self {
18895 address: 0_u16,
18896 ver: 0_u8,
18897 mavtype: 0_u8,
18898 value: [0_i8; 32usize],
18899 };
18900 #[cfg(feature = "arbitrary")]
18901 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
18902 use arbitrary::{Arbitrary, Unstructured};
18903 let mut buf = [0u8; 1024];
18904 rng.fill_bytes(&mut buf);
18905 let mut unstructured = Unstructured::new(&buf);
18906 Self::arbitrary(&mut unstructured).unwrap_or_default()
18907 }
18908}
18909impl Default for MEMORY_VECT_DATA {
18910 fn default() -> Self {
18911 Self::DEFAULT.clone()
18912 }
18913}
18914impl MessageData for MEMORY_VECT_DATA {
18915 type Message = MavMessage;
18916 const ID: u32 = 249u32;
18917 const NAME: &'static str = "MEMORY_VECT";
18918 const EXTRA_CRC: u8 = 204u8;
18919 const ENCODED_LEN: usize = 36usize;
18920 fn deser(
18921 _version: MavlinkVersion,
18922 __input: &[u8],
18923 ) -> Result<Self, ::mavlink_core::error::ParserError> {
18924 let avail_len = __input.len();
18925 let mut payload_buf = [0; Self::ENCODED_LEN];
18926 let mut buf = if avail_len < Self::ENCODED_LEN {
18927 payload_buf[0..avail_len].copy_from_slice(__input);
18928 Bytes::new(&payload_buf)
18929 } else {
18930 Bytes::new(__input)
18931 };
18932 let mut __struct = Self::default();
18933 __struct.address = buf.get_u16_le();
18934 __struct.ver = buf.get_u8();
18935 __struct.mavtype = buf.get_u8();
18936 for v in &mut __struct.value {
18937 let val = buf.get_i8();
18938 *v = val;
18939 }
18940 Ok(__struct)
18941 }
18942 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
18943 let mut __tmp = BytesMut::new(bytes);
18944 #[allow(clippy::absurd_extreme_comparisons)]
18945 #[allow(unused_comparisons)]
18946 if __tmp.remaining() < Self::ENCODED_LEN {
18947 panic!(
18948 "buffer is too small (need {} bytes, but got {})",
18949 Self::ENCODED_LEN,
18950 __tmp.remaining(),
18951 )
18952 }
18953 __tmp.put_u16_le(self.address);
18954 __tmp.put_u8(self.ver);
18955 __tmp.put_u8(self.mavtype);
18956 for val in &self.value {
18957 __tmp.put_i8(*val);
18958 }
18959 if matches!(version, MavlinkVersion::V2) {
18960 let len = __tmp.len();
18961 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
18962 } else {
18963 __tmp.len()
18964 }
18965 }
18966}
18967#[doc = "The interval between messages for a particular MAVLink message ID. This message is sent in response to the MAV_CMD_REQUEST_MESSAGE command with param1=244 (this message) and param2=message_id (the id of the message for which the interval is required). \tIt may also be sent in response to MAV_CMD_GET_MESSAGE_INTERVAL. \tThis interface replaces DATA_STREAM."]
18968#[doc = ""]
18969#[doc = "ID: 244"]
18970#[derive(Debug, Clone, PartialEq)]
18971#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
18972#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
18973pub struct MESSAGE_INTERVAL_DATA {
18974 #[doc = "0 indicates the interval at which it is sent."]
18975 pub interval_us: i32,
18976 #[doc = "The ID of the requested MAVLink message. v1.0 is limited to 254 messages."]
18977 pub message_id: u16,
18978}
18979impl MESSAGE_INTERVAL_DATA {
18980 pub const ENCODED_LEN: usize = 6usize;
18981 pub const DEFAULT: Self = Self {
18982 interval_us: 0_i32,
18983 message_id: 0_u16,
18984 };
18985 #[cfg(feature = "arbitrary")]
18986 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
18987 use arbitrary::{Arbitrary, Unstructured};
18988 let mut buf = [0u8; 1024];
18989 rng.fill_bytes(&mut buf);
18990 let mut unstructured = Unstructured::new(&buf);
18991 Self::arbitrary(&mut unstructured).unwrap_or_default()
18992 }
18993}
18994impl Default for MESSAGE_INTERVAL_DATA {
18995 fn default() -> Self {
18996 Self::DEFAULT.clone()
18997 }
18998}
18999impl MessageData for MESSAGE_INTERVAL_DATA {
19000 type Message = MavMessage;
19001 const ID: u32 = 244u32;
19002 const NAME: &'static str = "MESSAGE_INTERVAL";
19003 const EXTRA_CRC: u8 = 95u8;
19004 const ENCODED_LEN: usize = 6usize;
19005 fn deser(
19006 _version: MavlinkVersion,
19007 __input: &[u8],
19008 ) -> Result<Self, ::mavlink_core::error::ParserError> {
19009 let avail_len = __input.len();
19010 let mut payload_buf = [0; Self::ENCODED_LEN];
19011 let mut buf = if avail_len < Self::ENCODED_LEN {
19012 payload_buf[0..avail_len].copy_from_slice(__input);
19013 Bytes::new(&payload_buf)
19014 } else {
19015 Bytes::new(__input)
19016 };
19017 let mut __struct = Self::default();
19018 __struct.interval_us = buf.get_i32_le();
19019 __struct.message_id = buf.get_u16_le();
19020 Ok(__struct)
19021 }
19022 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
19023 let mut __tmp = BytesMut::new(bytes);
19024 #[allow(clippy::absurd_extreme_comparisons)]
19025 #[allow(unused_comparisons)]
19026 if __tmp.remaining() < Self::ENCODED_LEN {
19027 panic!(
19028 "buffer is too small (need {} bytes, but got {})",
19029 Self::ENCODED_LEN,
19030 __tmp.remaining(),
19031 )
19032 }
19033 __tmp.put_i32_le(self.interval_us);
19034 __tmp.put_u16_le(self.message_id);
19035 if matches!(version, MavlinkVersion::V2) {
19036 let len = __tmp.len();
19037 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
19038 } else {
19039 __tmp.len()
19040 }
19041 }
19042}
19043#[doc = "Acknowledgment message during waypoint handling. The type field states if this message is a positive ack (type=0) or if an error happened (type=non-zero)."]
19044#[doc = ""]
19045#[doc = "ID: 47"]
19046#[derive(Debug, Clone, PartialEq)]
19047#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
19048#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
19049pub struct MISSION_ACK_DATA {
19050 #[doc = "System ID"]
19051 pub target_system: u8,
19052 #[doc = "Component ID"]
19053 pub target_component: u8,
19054 #[doc = "Mission result."]
19055 pub mavtype: MavMissionResult,
19056 #[doc = "Mission type."]
19057 #[cfg_attr(feature = "serde", serde(default))]
19058 pub mission_type: MavMissionType,
19059 #[doc = "Id of new on-vehicle mission, fence, or rally point plan (on upload to vehicle). The id is calculated and returned by a vehicle when a new plan is uploaded by a GCS. The only requirement on the id is that it must change when there is any change to the on-vehicle plan type (there is no requirement that the id be globally unique). 0 on download from the vehicle to the GCS (on download the ID is set in MISSION_COUNT). 0 if plan ids are not supported. The current on-vehicle plan ids are streamed in `MISSION_CURRENT`, allowing a GCS to determine if any part of the plan has changed and needs to be re-uploaded."]
19060 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
19061 pub opaque_id: u32,
19062}
19063impl MISSION_ACK_DATA {
19064 pub const ENCODED_LEN: usize = 8usize;
19065 pub const DEFAULT: Self = Self {
19066 target_system: 0_u8,
19067 target_component: 0_u8,
19068 mavtype: MavMissionResult::DEFAULT,
19069 mission_type: MavMissionType::DEFAULT,
19070 opaque_id: 0_u32,
19071 };
19072 #[cfg(feature = "arbitrary")]
19073 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
19074 use arbitrary::{Arbitrary, Unstructured};
19075 let mut buf = [0u8; 1024];
19076 rng.fill_bytes(&mut buf);
19077 let mut unstructured = Unstructured::new(&buf);
19078 Self::arbitrary(&mut unstructured).unwrap_or_default()
19079 }
19080}
19081impl Default for MISSION_ACK_DATA {
19082 fn default() -> Self {
19083 Self::DEFAULT.clone()
19084 }
19085}
19086impl MessageData for MISSION_ACK_DATA {
19087 type Message = MavMessage;
19088 const ID: u32 = 47u32;
19089 const NAME: &'static str = "MISSION_ACK";
19090 const EXTRA_CRC: u8 = 153u8;
19091 const ENCODED_LEN: usize = 8usize;
19092 fn deser(
19093 _version: MavlinkVersion,
19094 __input: &[u8],
19095 ) -> Result<Self, ::mavlink_core::error::ParserError> {
19096 let avail_len = __input.len();
19097 let mut payload_buf = [0; Self::ENCODED_LEN];
19098 let mut buf = if avail_len < Self::ENCODED_LEN {
19099 payload_buf[0..avail_len].copy_from_slice(__input);
19100 Bytes::new(&payload_buf)
19101 } else {
19102 Bytes::new(__input)
19103 };
19104 let mut __struct = Self::default();
19105 __struct.target_system = buf.get_u8();
19106 __struct.target_component = buf.get_u8();
19107 let tmp = buf.get_u8();
19108 __struct.mavtype =
19109 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
19110 enum_type: "MavMissionResult",
19111 value: tmp as u32,
19112 })?;
19113 let tmp = buf.get_u8();
19114 __struct.mission_type =
19115 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
19116 enum_type: "MavMissionType",
19117 value: tmp as u32,
19118 })?;
19119 __struct.opaque_id = buf.get_u32_le();
19120 Ok(__struct)
19121 }
19122 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
19123 let mut __tmp = BytesMut::new(bytes);
19124 #[allow(clippy::absurd_extreme_comparisons)]
19125 #[allow(unused_comparisons)]
19126 if __tmp.remaining() < Self::ENCODED_LEN {
19127 panic!(
19128 "buffer is too small (need {} bytes, but got {})",
19129 Self::ENCODED_LEN,
19130 __tmp.remaining(),
19131 )
19132 }
19133 __tmp.put_u8(self.target_system);
19134 __tmp.put_u8(self.target_component);
19135 __tmp.put_u8(self.mavtype as u8);
19136 if matches!(version, MavlinkVersion::V2) {
19137 __tmp.put_u8(self.mission_type as u8);
19138 __tmp.put_u32_le(self.opaque_id);
19139 let len = __tmp.len();
19140 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
19141 } else {
19142 __tmp.len()
19143 }
19144 }
19145}
19146#[doc = "Delete all mission items at once."]
19147#[doc = ""]
19148#[doc = "ID: 45"]
19149#[derive(Debug, Clone, PartialEq)]
19150#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
19151#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
19152pub struct MISSION_CLEAR_ALL_DATA {
19153 #[doc = "System ID"]
19154 pub target_system: u8,
19155 #[doc = "Component ID"]
19156 pub target_component: u8,
19157 #[doc = "Mission type."]
19158 #[cfg_attr(feature = "serde", serde(default))]
19159 pub mission_type: MavMissionType,
19160}
19161impl MISSION_CLEAR_ALL_DATA {
19162 pub const ENCODED_LEN: usize = 3usize;
19163 pub const DEFAULT: Self = Self {
19164 target_system: 0_u8,
19165 target_component: 0_u8,
19166 mission_type: MavMissionType::DEFAULT,
19167 };
19168 #[cfg(feature = "arbitrary")]
19169 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
19170 use arbitrary::{Arbitrary, Unstructured};
19171 let mut buf = [0u8; 1024];
19172 rng.fill_bytes(&mut buf);
19173 let mut unstructured = Unstructured::new(&buf);
19174 Self::arbitrary(&mut unstructured).unwrap_or_default()
19175 }
19176}
19177impl Default for MISSION_CLEAR_ALL_DATA {
19178 fn default() -> Self {
19179 Self::DEFAULT.clone()
19180 }
19181}
19182impl MessageData for MISSION_CLEAR_ALL_DATA {
19183 type Message = MavMessage;
19184 const ID: u32 = 45u32;
19185 const NAME: &'static str = "MISSION_CLEAR_ALL";
19186 const EXTRA_CRC: u8 = 232u8;
19187 const ENCODED_LEN: usize = 3usize;
19188 fn deser(
19189 _version: MavlinkVersion,
19190 __input: &[u8],
19191 ) -> Result<Self, ::mavlink_core::error::ParserError> {
19192 let avail_len = __input.len();
19193 let mut payload_buf = [0; Self::ENCODED_LEN];
19194 let mut buf = if avail_len < Self::ENCODED_LEN {
19195 payload_buf[0..avail_len].copy_from_slice(__input);
19196 Bytes::new(&payload_buf)
19197 } else {
19198 Bytes::new(__input)
19199 };
19200 let mut __struct = Self::default();
19201 __struct.target_system = buf.get_u8();
19202 __struct.target_component = buf.get_u8();
19203 let tmp = buf.get_u8();
19204 __struct.mission_type =
19205 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
19206 enum_type: "MavMissionType",
19207 value: tmp as u32,
19208 })?;
19209 Ok(__struct)
19210 }
19211 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
19212 let mut __tmp = BytesMut::new(bytes);
19213 #[allow(clippy::absurd_extreme_comparisons)]
19214 #[allow(unused_comparisons)]
19215 if __tmp.remaining() < Self::ENCODED_LEN {
19216 panic!(
19217 "buffer is too small (need {} bytes, but got {})",
19218 Self::ENCODED_LEN,
19219 __tmp.remaining(),
19220 )
19221 }
19222 __tmp.put_u8(self.target_system);
19223 __tmp.put_u8(self.target_component);
19224 if matches!(version, MavlinkVersion::V2) {
19225 __tmp.put_u8(self.mission_type as u8);
19226 let len = __tmp.len();
19227 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
19228 } else {
19229 __tmp.len()
19230 }
19231 }
19232}
19233#[doc = "This message is emitted as response to MISSION_REQUEST_LIST by the MAV and to initiate a write transaction. The GCS can then request the individual mission item based on the knowledge of the total number of waypoints."]
19234#[doc = ""]
19235#[doc = "ID: 44"]
19236#[derive(Debug, Clone, PartialEq)]
19237#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
19238#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
19239pub struct MISSION_COUNT_DATA {
19240 #[doc = "Number of mission items in the sequence"]
19241 pub count: u16,
19242 #[doc = "System ID"]
19243 pub target_system: u8,
19244 #[doc = "Component ID"]
19245 pub target_component: u8,
19246 #[doc = "Mission type."]
19247 #[cfg_attr(feature = "serde", serde(default))]
19248 pub mission_type: MavMissionType,
19249 #[doc = "Id of current on-vehicle mission, fence, or rally point plan (on download from vehicle). This field is used when downloading a plan from a vehicle to a GCS. 0 on upload to the vehicle from GCS. 0 if plan ids are not supported. The current on-vehicle plan ids are streamed in `MISSION_CURRENT`, allowing a GCS to determine if any part of the plan has changed and needs to be re-uploaded. The ids are recalculated by the vehicle when any part of the on-vehicle plan changes (when a new plan is uploaded, the vehicle returns the new id to the GCS in MISSION_ACK)."]
19250 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
19251 pub opaque_id: u32,
19252}
19253impl MISSION_COUNT_DATA {
19254 pub const ENCODED_LEN: usize = 9usize;
19255 pub const DEFAULT: Self = Self {
19256 count: 0_u16,
19257 target_system: 0_u8,
19258 target_component: 0_u8,
19259 mission_type: MavMissionType::DEFAULT,
19260 opaque_id: 0_u32,
19261 };
19262 #[cfg(feature = "arbitrary")]
19263 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
19264 use arbitrary::{Arbitrary, Unstructured};
19265 let mut buf = [0u8; 1024];
19266 rng.fill_bytes(&mut buf);
19267 let mut unstructured = Unstructured::new(&buf);
19268 Self::arbitrary(&mut unstructured).unwrap_or_default()
19269 }
19270}
19271impl Default for MISSION_COUNT_DATA {
19272 fn default() -> Self {
19273 Self::DEFAULT.clone()
19274 }
19275}
19276impl MessageData for MISSION_COUNT_DATA {
19277 type Message = MavMessage;
19278 const ID: u32 = 44u32;
19279 const NAME: &'static str = "MISSION_COUNT";
19280 const EXTRA_CRC: u8 = 221u8;
19281 const ENCODED_LEN: usize = 9usize;
19282 fn deser(
19283 _version: MavlinkVersion,
19284 __input: &[u8],
19285 ) -> Result<Self, ::mavlink_core::error::ParserError> {
19286 let avail_len = __input.len();
19287 let mut payload_buf = [0; Self::ENCODED_LEN];
19288 let mut buf = if avail_len < Self::ENCODED_LEN {
19289 payload_buf[0..avail_len].copy_from_slice(__input);
19290 Bytes::new(&payload_buf)
19291 } else {
19292 Bytes::new(__input)
19293 };
19294 let mut __struct = Self::default();
19295 __struct.count = buf.get_u16_le();
19296 __struct.target_system = buf.get_u8();
19297 __struct.target_component = buf.get_u8();
19298 let tmp = buf.get_u8();
19299 __struct.mission_type =
19300 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
19301 enum_type: "MavMissionType",
19302 value: tmp as u32,
19303 })?;
19304 __struct.opaque_id = buf.get_u32_le();
19305 Ok(__struct)
19306 }
19307 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
19308 let mut __tmp = BytesMut::new(bytes);
19309 #[allow(clippy::absurd_extreme_comparisons)]
19310 #[allow(unused_comparisons)]
19311 if __tmp.remaining() < Self::ENCODED_LEN {
19312 panic!(
19313 "buffer is too small (need {} bytes, but got {})",
19314 Self::ENCODED_LEN,
19315 __tmp.remaining(),
19316 )
19317 }
19318 __tmp.put_u16_le(self.count);
19319 __tmp.put_u8(self.target_system);
19320 __tmp.put_u8(self.target_component);
19321 if matches!(version, MavlinkVersion::V2) {
19322 __tmp.put_u8(self.mission_type as u8);
19323 __tmp.put_u32_le(self.opaque_id);
19324 let len = __tmp.len();
19325 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
19326 } else {
19327 __tmp.len()
19328 }
19329 }
19330}
19331#[doc = "Message that announces the sequence number of the current target mission item (that the system will fly towards/execute when the mission is running). This message should be streamed all the time (nominally at 1Hz). This message should be emitted following a call to MAV_CMD_DO_SET_MISSION_CURRENT or MISSION_SET_CURRENT."]
19332#[doc = ""]
19333#[doc = "ID: 42"]
19334#[derive(Debug, Clone, PartialEq)]
19335#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
19336#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
19337pub struct MISSION_CURRENT_DATA {
19338 #[doc = "Sequence"]
19339 pub seq: u16,
19340 #[doc = "Total number of mission items on vehicle (on last item, sequence == total). If the autopilot stores its home location as part of the mission this will be excluded from the total. 0: Not supported, UINT16_MAX if no mission is present on the vehicle."]
19341 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
19342 pub total: u16,
19343 #[doc = "Mission state machine state. MISSION_STATE_UNKNOWN if state reporting not supported."]
19344 #[cfg_attr(feature = "serde", serde(default))]
19345 pub mission_state: MissionState,
19346 #[doc = "Vehicle is in a mode that can execute mission items or suspended. 0: Unknown, 1: In mission mode, 2: Suspended (not in mission mode)."]
19347 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
19348 pub mission_mode: u8,
19349 #[doc = "Id of current on-vehicle mission plan, or 0 if IDs are not supported or there is no mission loaded. GCS can use this to track changes to the mission plan type. The same value is returned on mission upload (in the MISSION_ACK)."]
19350 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
19351 pub mission_id: u32,
19352 #[doc = "Id of current on-vehicle fence plan, or 0 if IDs are not supported or there is no fence loaded. GCS can use this to track changes to the fence plan type. The same value is returned on fence upload (in the MISSION_ACK)."]
19353 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
19354 pub fence_id: u32,
19355 #[doc = "Id of current on-vehicle rally point plan, or 0 if IDs are not supported or there are no rally points loaded. GCS can use this to track changes to the rally point plan type. The same value is returned on rally point upload (in the MISSION_ACK)."]
19356 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
19357 pub rally_points_id: u32,
19358}
19359impl MISSION_CURRENT_DATA {
19360 pub const ENCODED_LEN: usize = 18usize;
19361 pub const DEFAULT: Self = Self {
19362 seq: 0_u16,
19363 total: 0_u16,
19364 mission_state: MissionState::DEFAULT,
19365 mission_mode: 0_u8,
19366 mission_id: 0_u32,
19367 fence_id: 0_u32,
19368 rally_points_id: 0_u32,
19369 };
19370 #[cfg(feature = "arbitrary")]
19371 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
19372 use arbitrary::{Arbitrary, Unstructured};
19373 let mut buf = [0u8; 1024];
19374 rng.fill_bytes(&mut buf);
19375 let mut unstructured = Unstructured::new(&buf);
19376 Self::arbitrary(&mut unstructured).unwrap_or_default()
19377 }
19378}
19379impl Default for MISSION_CURRENT_DATA {
19380 fn default() -> Self {
19381 Self::DEFAULT.clone()
19382 }
19383}
19384impl MessageData for MISSION_CURRENT_DATA {
19385 type Message = MavMessage;
19386 const ID: u32 = 42u32;
19387 const NAME: &'static str = "MISSION_CURRENT";
19388 const EXTRA_CRC: u8 = 28u8;
19389 const ENCODED_LEN: usize = 18usize;
19390 fn deser(
19391 _version: MavlinkVersion,
19392 __input: &[u8],
19393 ) -> Result<Self, ::mavlink_core::error::ParserError> {
19394 let avail_len = __input.len();
19395 let mut payload_buf = [0; Self::ENCODED_LEN];
19396 let mut buf = if avail_len < Self::ENCODED_LEN {
19397 payload_buf[0..avail_len].copy_from_slice(__input);
19398 Bytes::new(&payload_buf)
19399 } else {
19400 Bytes::new(__input)
19401 };
19402 let mut __struct = Self::default();
19403 __struct.seq = buf.get_u16_le();
19404 __struct.total = buf.get_u16_le();
19405 let tmp = buf.get_u8();
19406 __struct.mission_state =
19407 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
19408 enum_type: "MissionState",
19409 value: tmp as u32,
19410 })?;
19411 __struct.mission_mode = buf.get_u8();
19412 __struct.mission_id = buf.get_u32_le();
19413 __struct.fence_id = buf.get_u32_le();
19414 __struct.rally_points_id = buf.get_u32_le();
19415 Ok(__struct)
19416 }
19417 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
19418 let mut __tmp = BytesMut::new(bytes);
19419 #[allow(clippy::absurd_extreme_comparisons)]
19420 #[allow(unused_comparisons)]
19421 if __tmp.remaining() < Self::ENCODED_LEN {
19422 panic!(
19423 "buffer is too small (need {} bytes, but got {})",
19424 Self::ENCODED_LEN,
19425 __tmp.remaining(),
19426 )
19427 }
19428 __tmp.put_u16_le(self.seq);
19429 if matches!(version, MavlinkVersion::V2) {
19430 __tmp.put_u16_le(self.total);
19431 __tmp.put_u8(self.mission_state as u8);
19432 __tmp.put_u8(self.mission_mode);
19433 __tmp.put_u32_le(self.mission_id);
19434 __tmp.put_u32_le(self.fence_id);
19435 __tmp.put_u32_le(self.rally_points_id);
19436 let len = __tmp.len();
19437 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
19438 } else {
19439 __tmp.len()
19440 }
19441 }
19442}
19443#[deprecated = " See `MISSION_ITEM_INT` (Deprecated since 2020-06)"]
19444#[doc = "Message encoding a mission item. This message is emitted to announce the presence of a mission item and to set a mission item on the system. The mission item can be either in x, y, z meters (type: LOCAL) or x:lat, y:lon, z:altitude. Local frame is Z-down, right handed (NED), global frame is Z-up, right handed (ENU). NaN may be used to indicate an optional/default value (e.g. to use the system's current latitude or yaw rather than a specific value). See also <https://mavlink.io/en/services/mission.html>."]
19445#[doc = ""]
19446#[doc = "ID: 39"]
19447#[derive(Debug, Clone, PartialEq)]
19448#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
19449#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
19450pub struct MISSION_ITEM_DATA {
19451 #[doc = "PARAM1, see MAV_CMD enum"]
19452 pub param1: f32,
19453 #[doc = "PARAM2, see MAV_CMD enum"]
19454 pub param2: f32,
19455 #[doc = "PARAM3, see MAV_CMD enum"]
19456 pub param3: f32,
19457 #[doc = "PARAM4, see MAV_CMD enum"]
19458 pub param4: f32,
19459 #[doc = "PARAM5 / local: X coordinate, global: latitude"]
19460 pub x: f32,
19461 #[doc = "PARAM6 / local: Y coordinate, global: longitude"]
19462 pub y: f32,
19463 #[doc = "PARAM7 / local: Z coordinate, global: altitude (relative or absolute, depending on frame)."]
19464 pub z: f32,
19465 #[doc = "Sequence"]
19466 pub seq: u16,
19467 #[doc = "The scheduled action for the waypoint."]
19468 pub command: MavCmd,
19469 #[doc = "System ID"]
19470 pub target_system: u8,
19471 #[doc = "Component ID"]
19472 pub target_component: u8,
19473 #[doc = "The coordinate system of the waypoint."]
19474 pub frame: MavFrame,
19475 #[doc = "false:0, true:1"]
19476 pub current: u8,
19477 #[doc = "Autocontinue to next waypoint. 0: false, 1: true. Set false to pause mission after the item completes."]
19478 pub autocontinue: u8,
19479 #[doc = "Mission type."]
19480 #[cfg_attr(feature = "serde", serde(default))]
19481 pub mission_type: MavMissionType,
19482}
19483impl MISSION_ITEM_DATA {
19484 pub const ENCODED_LEN: usize = 38usize;
19485 pub const DEFAULT: Self = Self {
19486 param1: 0.0_f32,
19487 param2: 0.0_f32,
19488 param3: 0.0_f32,
19489 param4: 0.0_f32,
19490 x: 0.0_f32,
19491 y: 0.0_f32,
19492 z: 0.0_f32,
19493 seq: 0_u16,
19494 command: MavCmd::DEFAULT,
19495 target_system: 0_u8,
19496 target_component: 0_u8,
19497 frame: MavFrame::DEFAULT,
19498 current: 0_u8,
19499 autocontinue: 0_u8,
19500 mission_type: MavMissionType::DEFAULT,
19501 };
19502 #[cfg(feature = "arbitrary")]
19503 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
19504 use arbitrary::{Arbitrary, Unstructured};
19505 let mut buf = [0u8; 1024];
19506 rng.fill_bytes(&mut buf);
19507 let mut unstructured = Unstructured::new(&buf);
19508 Self::arbitrary(&mut unstructured).unwrap_or_default()
19509 }
19510}
19511impl Default for MISSION_ITEM_DATA {
19512 fn default() -> Self {
19513 Self::DEFAULT.clone()
19514 }
19515}
19516impl MessageData for MISSION_ITEM_DATA {
19517 type Message = MavMessage;
19518 const ID: u32 = 39u32;
19519 const NAME: &'static str = "MISSION_ITEM";
19520 const EXTRA_CRC: u8 = 254u8;
19521 const ENCODED_LEN: usize = 38usize;
19522 fn deser(
19523 _version: MavlinkVersion,
19524 __input: &[u8],
19525 ) -> Result<Self, ::mavlink_core::error::ParserError> {
19526 let avail_len = __input.len();
19527 let mut payload_buf = [0; Self::ENCODED_LEN];
19528 let mut buf = if avail_len < Self::ENCODED_LEN {
19529 payload_buf[0..avail_len].copy_from_slice(__input);
19530 Bytes::new(&payload_buf)
19531 } else {
19532 Bytes::new(__input)
19533 };
19534 let mut __struct = Self::default();
19535 __struct.param1 = buf.get_f32_le();
19536 __struct.param2 = buf.get_f32_le();
19537 __struct.param3 = buf.get_f32_le();
19538 __struct.param4 = buf.get_f32_le();
19539 __struct.x = buf.get_f32_le();
19540 __struct.y = buf.get_f32_le();
19541 __struct.z = buf.get_f32_le();
19542 __struct.seq = buf.get_u16_le();
19543 let tmp = buf.get_u16_le();
19544 __struct.command = FromPrimitive::from_u16(tmp).ok_or(
19545 ::mavlink_core::error::ParserError::InvalidEnum {
19546 enum_type: "MavCmd",
19547 value: tmp as u32,
19548 },
19549 )?;
19550 __struct.target_system = buf.get_u8();
19551 __struct.target_component = buf.get_u8();
19552 let tmp = buf.get_u8();
19553 __struct.frame =
19554 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
19555 enum_type: "MavFrame",
19556 value: tmp as u32,
19557 })?;
19558 __struct.current = buf.get_u8();
19559 __struct.autocontinue = buf.get_u8();
19560 let tmp = buf.get_u8();
19561 __struct.mission_type =
19562 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
19563 enum_type: "MavMissionType",
19564 value: tmp as u32,
19565 })?;
19566 Ok(__struct)
19567 }
19568 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
19569 let mut __tmp = BytesMut::new(bytes);
19570 #[allow(clippy::absurd_extreme_comparisons)]
19571 #[allow(unused_comparisons)]
19572 if __tmp.remaining() < Self::ENCODED_LEN {
19573 panic!(
19574 "buffer is too small (need {} bytes, but got {})",
19575 Self::ENCODED_LEN,
19576 __tmp.remaining(),
19577 )
19578 }
19579 __tmp.put_f32_le(self.param1);
19580 __tmp.put_f32_le(self.param2);
19581 __tmp.put_f32_le(self.param3);
19582 __tmp.put_f32_le(self.param4);
19583 __tmp.put_f32_le(self.x);
19584 __tmp.put_f32_le(self.y);
19585 __tmp.put_f32_le(self.z);
19586 __tmp.put_u16_le(self.seq);
19587 __tmp.put_u16_le(self.command as u16);
19588 __tmp.put_u8(self.target_system);
19589 __tmp.put_u8(self.target_component);
19590 __tmp.put_u8(self.frame as u8);
19591 __tmp.put_u8(self.current);
19592 __tmp.put_u8(self.autocontinue);
19593 if matches!(version, MavlinkVersion::V2) {
19594 __tmp.put_u8(self.mission_type as u8);
19595 let len = __tmp.len();
19596 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
19597 } else {
19598 __tmp.len()
19599 }
19600 }
19601}
19602#[doc = "Message encoding a mission item. This message is emitted to announce the presence of a mission item and to set a mission item on the system. The mission item can be either in x, y, z meters (type: LOCAL) or x:lat, y:lon, z:altitude. Local frame is Z-down, right handed (NED), global frame is Z-up, right handed (ENU). NaN or INT32_MAX may be used in float/integer params (respectively) to indicate optional/default values (e.g. to use the component's current latitude, yaw rather than a specific value). See also <https://mavlink.io/en/services/mission.html>."]
19603#[doc = ""]
19604#[doc = "ID: 73"]
19605#[derive(Debug, Clone, PartialEq)]
19606#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
19607#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
19608pub struct MISSION_ITEM_INT_DATA {
19609 #[doc = "PARAM1, see MAV_CMD enum"]
19610 pub param1: f32,
19611 #[doc = "PARAM2, see MAV_CMD enum"]
19612 pub param2: f32,
19613 #[doc = "PARAM3, see MAV_CMD enum"]
19614 pub param3: f32,
19615 #[doc = "PARAM4, see MAV_CMD enum"]
19616 pub param4: f32,
19617 #[doc = "PARAM5 / local: x position in meters * 1e4, global: latitude in degrees * 10^7"]
19618 pub x: i32,
19619 #[doc = "PARAM6 / y position: local: x position in meters * 1e4, global: longitude in degrees *10^7"]
19620 pub y: i32,
19621 #[doc = "PARAM7 / z position: global: altitude in meters (relative or absolute, depending on frame."]
19622 pub z: f32,
19623 #[doc = "Waypoint ID (sequence number). Starts at zero. Increases monotonically for each waypoint, no gaps in the sequence (0,1,2,3,4)."]
19624 pub seq: u16,
19625 #[doc = "The scheduled action for the waypoint."]
19626 pub command: MavCmd,
19627 #[doc = "System ID"]
19628 pub target_system: u8,
19629 #[doc = "Component ID"]
19630 pub target_component: u8,
19631 #[doc = "The coordinate system of the waypoint."]
19632 pub frame: MavFrame,
19633 #[doc = "false:0, true:1"]
19634 pub current: u8,
19635 #[doc = "Autocontinue to next waypoint. 0: false, 1: true. Set false to pause mission after the item completes."]
19636 pub autocontinue: u8,
19637 #[doc = "Mission type."]
19638 #[cfg_attr(feature = "serde", serde(default))]
19639 pub mission_type: MavMissionType,
19640}
19641impl MISSION_ITEM_INT_DATA {
19642 pub const ENCODED_LEN: usize = 38usize;
19643 pub const DEFAULT: Self = Self {
19644 param1: 0.0_f32,
19645 param2: 0.0_f32,
19646 param3: 0.0_f32,
19647 param4: 0.0_f32,
19648 x: 0_i32,
19649 y: 0_i32,
19650 z: 0.0_f32,
19651 seq: 0_u16,
19652 command: MavCmd::DEFAULT,
19653 target_system: 0_u8,
19654 target_component: 0_u8,
19655 frame: MavFrame::DEFAULT,
19656 current: 0_u8,
19657 autocontinue: 0_u8,
19658 mission_type: MavMissionType::DEFAULT,
19659 };
19660 #[cfg(feature = "arbitrary")]
19661 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
19662 use arbitrary::{Arbitrary, Unstructured};
19663 let mut buf = [0u8; 1024];
19664 rng.fill_bytes(&mut buf);
19665 let mut unstructured = Unstructured::new(&buf);
19666 Self::arbitrary(&mut unstructured).unwrap_or_default()
19667 }
19668}
19669impl Default for MISSION_ITEM_INT_DATA {
19670 fn default() -> Self {
19671 Self::DEFAULT.clone()
19672 }
19673}
19674impl MessageData for MISSION_ITEM_INT_DATA {
19675 type Message = MavMessage;
19676 const ID: u32 = 73u32;
19677 const NAME: &'static str = "MISSION_ITEM_INT";
19678 const EXTRA_CRC: u8 = 38u8;
19679 const ENCODED_LEN: usize = 38usize;
19680 fn deser(
19681 _version: MavlinkVersion,
19682 __input: &[u8],
19683 ) -> Result<Self, ::mavlink_core::error::ParserError> {
19684 let avail_len = __input.len();
19685 let mut payload_buf = [0; Self::ENCODED_LEN];
19686 let mut buf = if avail_len < Self::ENCODED_LEN {
19687 payload_buf[0..avail_len].copy_from_slice(__input);
19688 Bytes::new(&payload_buf)
19689 } else {
19690 Bytes::new(__input)
19691 };
19692 let mut __struct = Self::default();
19693 __struct.param1 = buf.get_f32_le();
19694 __struct.param2 = buf.get_f32_le();
19695 __struct.param3 = buf.get_f32_le();
19696 __struct.param4 = buf.get_f32_le();
19697 __struct.x = buf.get_i32_le();
19698 __struct.y = buf.get_i32_le();
19699 __struct.z = buf.get_f32_le();
19700 __struct.seq = buf.get_u16_le();
19701 let tmp = buf.get_u16_le();
19702 __struct.command = FromPrimitive::from_u16(tmp).ok_or(
19703 ::mavlink_core::error::ParserError::InvalidEnum {
19704 enum_type: "MavCmd",
19705 value: tmp as u32,
19706 },
19707 )?;
19708 __struct.target_system = buf.get_u8();
19709 __struct.target_component = buf.get_u8();
19710 let tmp = buf.get_u8();
19711 __struct.frame =
19712 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
19713 enum_type: "MavFrame",
19714 value: tmp as u32,
19715 })?;
19716 __struct.current = buf.get_u8();
19717 __struct.autocontinue = buf.get_u8();
19718 let tmp = buf.get_u8();
19719 __struct.mission_type =
19720 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
19721 enum_type: "MavMissionType",
19722 value: tmp as u32,
19723 })?;
19724 Ok(__struct)
19725 }
19726 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
19727 let mut __tmp = BytesMut::new(bytes);
19728 #[allow(clippy::absurd_extreme_comparisons)]
19729 #[allow(unused_comparisons)]
19730 if __tmp.remaining() < Self::ENCODED_LEN {
19731 panic!(
19732 "buffer is too small (need {} bytes, but got {})",
19733 Self::ENCODED_LEN,
19734 __tmp.remaining(),
19735 )
19736 }
19737 __tmp.put_f32_le(self.param1);
19738 __tmp.put_f32_le(self.param2);
19739 __tmp.put_f32_le(self.param3);
19740 __tmp.put_f32_le(self.param4);
19741 __tmp.put_i32_le(self.x);
19742 __tmp.put_i32_le(self.y);
19743 __tmp.put_f32_le(self.z);
19744 __tmp.put_u16_le(self.seq);
19745 __tmp.put_u16_le(self.command as u16);
19746 __tmp.put_u8(self.target_system);
19747 __tmp.put_u8(self.target_component);
19748 __tmp.put_u8(self.frame as u8);
19749 __tmp.put_u8(self.current);
19750 __tmp.put_u8(self.autocontinue);
19751 if matches!(version, MavlinkVersion::V2) {
19752 __tmp.put_u8(self.mission_type as u8);
19753 let len = __tmp.len();
19754 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
19755 } else {
19756 __tmp.len()
19757 }
19758 }
19759}
19760#[doc = "A certain mission item has been reached. The system will either hold this position (or circle on the orbit) or (if the autocontinue on the WP was set) continue to the next waypoint."]
19761#[doc = ""]
19762#[doc = "ID: 46"]
19763#[derive(Debug, Clone, PartialEq)]
19764#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
19765#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
19766pub struct MISSION_ITEM_REACHED_DATA {
19767 #[doc = "Sequence"]
19768 pub seq: u16,
19769}
19770impl MISSION_ITEM_REACHED_DATA {
19771 pub const ENCODED_LEN: usize = 2usize;
19772 pub const DEFAULT: Self = Self { seq: 0_u16 };
19773 #[cfg(feature = "arbitrary")]
19774 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
19775 use arbitrary::{Arbitrary, Unstructured};
19776 let mut buf = [0u8; 1024];
19777 rng.fill_bytes(&mut buf);
19778 let mut unstructured = Unstructured::new(&buf);
19779 Self::arbitrary(&mut unstructured).unwrap_or_default()
19780 }
19781}
19782impl Default for MISSION_ITEM_REACHED_DATA {
19783 fn default() -> Self {
19784 Self::DEFAULT.clone()
19785 }
19786}
19787impl MessageData for MISSION_ITEM_REACHED_DATA {
19788 type Message = MavMessage;
19789 const ID: u32 = 46u32;
19790 const NAME: &'static str = "MISSION_ITEM_REACHED";
19791 const EXTRA_CRC: u8 = 11u8;
19792 const ENCODED_LEN: usize = 2usize;
19793 fn deser(
19794 _version: MavlinkVersion,
19795 __input: &[u8],
19796 ) -> Result<Self, ::mavlink_core::error::ParserError> {
19797 let avail_len = __input.len();
19798 let mut payload_buf = [0; Self::ENCODED_LEN];
19799 let mut buf = if avail_len < Self::ENCODED_LEN {
19800 payload_buf[0..avail_len].copy_from_slice(__input);
19801 Bytes::new(&payload_buf)
19802 } else {
19803 Bytes::new(__input)
19804 };
19805 let mut __struct = Self::default();
19806 __struct.seq = buf.get_u16_le();
19807 Ok(__struct)
19808 }
19809 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
19810 let mut __tmp = BytesMut::new(bytes);
19811 #[allow(clippy::absurd_extreme_comparisons)]
19812 #[allow(unused_comparisons)]
19813 if __tmp.remaining() < Self::ENCODED_LEN {
19814 panic!(
19815 "buffer is too small (need {} bytes, but got {})",
19816 Self::ENCODED_LEN,
19817 __tmp.remaining(),
19818 )
19819 }
19820 __tmp.put_u16_le(self.seq);
19821 if matches!(version, MavlinkVersion::V2) {
19822 let len = __tmp.len();
19823 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
19824 } else {
19825 __tmp.len()
19826 }
19827 }
19828}
19829#[deprecated = "A system that gets this request should respond with MISSION_ITEM_INT (as though MISSION_REQUEST_INT was received). See `MISSION_REQUEST_INT` (Deprecated since 2020-06)"]
19830#[doc = "Request the information of the mission item with the sequence number seq. The response of the system to this message should be a MISSION_ITEM message. <https://mavlink.io/en/services/mission.html>."]
19831#[doc = ""]
19832#[doc = "ID: 40"]
19833#[derive(Debug, Clone, PartialEq)]
19834#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
19835#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
19836pub struct MISSION_REQUEST_DATA {
19837 #[doc = "Sequence"]
19838 pub seq: u16,
19839 #[doc = "System ID"]
19840 pub target_system: u8,
19841 #[doc = "Component ID"]
19842 pub target_component: u8,
19843 #[doc = "Mission type."]
19844 #[cfg_attr(feature = "serde", serde(default))]
19845 pub mission_type: MavMissionType,
19846}
19847impl MISSION_REQUEST_DATA {
19848 pub const ENCODED_LEN: usize = 5usize;
19849 pub const DEFAULT: Self = Self {
19850 seq: 0_u16,
19851 target_system: 0_u8,
19852 target_component: 0_u8,
19853 mission_type: MavMissionType::DEFAULT,
19854 };
19855 #[cfg(feature = "arbitrary")]
19856 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
19857 use arbitrary::{Arbitrary, Unstructured};
19858 let mut buf = [0u8; 1024];
19859 rng.fill_bytes(&mut buf);
19860 let mut unstructured = Unstructured::new(&buf);
19861 Self::arbitrary(&mut unstructured).unwrap_or_default()
19862 }
19863}
19864impl Default for MISSION_REQUEST_DATA {
19865 fn default() -> Self {
19866 Self::DEFAULT.clone()
19867 }
19868}
19869impl MessageData for MISSION_REQUEST_DATA {
19870 type Message = MavMessage;
19871 const ID: u32 = 40u32;
19872 const NAME: &'static str = "MISSION_REQUEST";
19873 const EXTRA_CRC: u8 = 230u8;
19874 const ENCODED_LEN: usize = 5usize;
19875 fn deser(
19876 _version: MavlinkVersion,
19877 __input: &[u8],
19878 ) -> Result<Self, ::mavlink_core::error::ParserError> {
19879 let avail_len = __input.len();
19880 let mut payload_buf = [0; Self::ENCODED_LEN];
19881 let mut buf = if avail_len < Self::ENCODED_LEN {
19882 payload_buf[0..avail_len].copy_from_slice(__input);
19883 Bytes::new(&payload_buf)
19884 } else {
19885 Bytes::new(__input)
19886 };
19887 let mut __struct = Self::default();
19888 __struct.seq = buf.get_u16_le();
19889 __struct.target_system = buf.get_u8();
19890 __struct.target_component = buf.get_u8();
19891 let tmp = buf.get_u8();
19892 __struct.mission_type =
19893 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
19894 enum_type: "MavMissionType",
19895 value: tmp as u32,
19896 })?;
19897 Ok(__struct)
19898 }
19899 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
19900 let mut __tmp = BytesMut::new(bytes);
19901 #[allow(clippy::absurd_extreme_comparisons)]
19902 #[allow(unused_comparisons)]
19903 if __tmp.remaining() < Self::ENCODED_LEN {
19904 panic!(
19905 "buffer is too small (need {} bytes, but got {})",
19906 Self::ENCODED_LEN,
19907 __tmp.remaining(),
19908 )
19909 }
19910 __tmp.put_u16_le(self.seq);
19911 __tmp.put_u8(self.target_system);
19912 __tmp.put_u8(self.target_component);
19913 if matches!(version, MavlinkVersion::V2) {
19914 __tmp.put_u8(self.mission_type as u8);
19915 let len = __tmp.len();
19916 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
19917 } else {
19918 __tmp.len()
19919 }
19920 }
19921}
19922#[doc = "Request the information of the mission item with the sequence number seq. The response of the system to this message should be a MISSION_ITEM_INT message. <https://mavlink.io/en/services/mission.html>."]
19923#[doc = ""]
19924#[doc = "ID: 51"]
19925#[derive(Debug, Clone, PartialEq)]
19926#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
19927#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
19928pub struct MISSION_REQUEST_INT_DATA {
19929 #[doc = "Sequence"]
19930 pub seq: u16,
19931 #[doc = "System ID"]
19932 pub target_system: u8,
19933 #[doc = "Component ID"]
19934 pub target_component: u8,
19935 #[doc = "Mission type."]
19936 #[cfg_attr(feature = "serde", serde(default))]
19937 pub mission_type: MavMissionType,
19938}
19939impl MISSION_REQUEST_INT_DATA {
19940 pub const ENCODED_LEN: usize = 5usize;
19941 pub const DEFAULT: Self = Self {
19942 seq: 0_u16,
19943 target_system: 0_u8,
19944 target_component: 0_u8,
19945 mission_type: MavMissionType::DEFAULT,
19946 };
19947 #[cfg(feature = "arbitrary")]
19948 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
19949 use arbitrary::{Arbitrary, Unstructured};
19950 let mut buf = [0u8; 1024];
19951 rng.fill_bytes(&mut buf);
19952 let mut unstructured = Unstructured::new(&buf);
19953 Self::arbitrary(&mut unstructured).unwrap_or_default()
19954 }
19955}
19956impl Default for MISSION_REQUEST_INT_DATA {
19957 fn default() -> Self {
19958 Self::DEFAULT.clone()
19959 }
19960}
19961impl MessageData for MISSION_REQUEST_INT_DATA {
19962 type Message = MavMessage;
19963 const ID: u32 = 51u32;
19964 const NAME: &'static str = "MISSION_REQUEST_INT";
19965 const EXTRA_CRC: u8 = 196u8;
19966 const ENCODED_LEN: usize = 5usize;
19967 fn deser(
19968 _version: MavlinkVersion,
19969 __input: &[u8],
19970 ) -> Result<Self, ::mavlink_core::error::ParserError> {
19971 let avail_len = __input.len();
19972 let mut payload_buf = [0; Self::ENCODED_LEN];
19973 let mut buf = if avail_len < Self::ENCODED_LEN {
19974 payload_buf[0..avail_len].copy_from_slice(__input);
19975 Bytes::new(&payload_buf)
19976 } else {
19977 Bytes::new(__input)
19978 };
19979 let mut __struct = Self::default();
19980 __struct.seq = buf.get_u16_le();
19981 __struct.target_system = buf.get_u8();
19982 __struct.target_component = buf.get_u8();
19983 let tmp = buf.get_u8();
19984 __struct.mission_type =
19985 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
19986 enum_type: "MavMissionType",
19987 value: tmp as u32,
19988 })?;
19989 Ok(__struct)
19990 }
19991 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
19992 let mut __tmp = BytesMut::new(bytes);
19993 #[allow(clippy::absurd_extreme_comparisons)]
19994 #[allow(unused_comparisons)]
19995 if __tmp.remaining() < Self::ENCODED_LEN {
19996 panic!(
19997 "buffer is too small (need {} bytes, but got {})",
19998 Self::ENCODED_LEN,
19999 __tmp.remaining(),
20000 )
20001 }
20002 __tmp.put_u16_le(self.seq);
20003 __tmp.put_u8(self.target_system);
20004 __tmp.put_u8(self.target_component);
20005 if matches!(version, MavlinkVersion::V2) {
20006 __tmp.put_u8(self.mission_type as u8);
20007 let len = __tmp.len();
20008 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
20009 } else {
20010 __tmp.len()
20011 }
20012 }
20013}
20014#[doc = "Request the overall list of mission items from the system/component."]
20015#[doc = ""]
20016#[doc = "ID: 43"]
20017#[derive(Debug, Clone, PartialEq)]
20018#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
20019#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
20020pub struct MISSION_REQUEST_LIST_DATA {
20021 #[doc = "System ID"]
20022 pub target_system: u8,
20023 #[doc = "Component ID"]
20024 pub target_component: u8,
20025 #[doc = "Mission type."]
20026 #[cfg_attr(feature = "serde", serde(default))]
20027 pub mission_type: MavMissionType,
20028}
20029impl MISSION_REQUEST_LIST_DATA {
20030 pub const ENCODED_LEN: usize = 3usize;
20031 pub const DEFAULT: Self = Self {
20032 target_system: 0_u8,
20033 target_component: 0_u8,
20034 mission_type: MavMissionType::DEFAULT,
20035 };
20036 #[cfg(feature = "arbitrary")]
20037 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
20038 use arbitrary::{Arbitrary, Unstructured};
20039 let mut buf = [0u8; 1024];
20040 rng.fill_bytes(&mut buf);
20041 let mut unstructured = Unstructured::new(&buf);
20042 Self::arbitrary(&mut unstructured).unwrap_or_default()
20043 }
20044}
20045impl Default for MISSION_REQUEST_LIST_DATA {
20046 fn default() -> Self {
20047 Self::DEFAULT.clone()
20048 }
20049}
20050impl MessageData for MISSION_REQUEST_LIST_DATA {
20051 type Message = MavMessage;
20052 const ID: u32 = 43u32;
20053 const NAME: &'static str = "MISSION_REQUEST_LIST";
20054 const EXTRA_CRC: u8 = 132u8;
20055 const ENCODED_LEN: usize = 3usize;
20056 fn deser(
20057 _version: MavlinkVersion,
20058 __input: &[u8],
20059 ) -> Result<Self, ::mavlink_core::error::ParserError> {
20060 let avail_len = __input.len();
20061 let mut payload_buf = [0; Self::ENCODED_LEN];
20062 let mut buf = if avail_len < Self::ENCODED_LEN {
20063 payload_buf[0..avail_len].copy_from_slice(__input);
20064 Bytes::new(&payload_buf)
20065 } else {
20066 Bytes::new(__input)
20067 };
20068 let mut __struct = Self::default();
20069 __struct.target_system = buf.get_u8();
20070 __struct.target_component = buf.get_u8();
20071 let tmp = buf.get_u8();
20072 __struct.mission_type =
20073 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
20074 enum_type: "MavMissionType",
20075 value: tmp as u32,
20076 })?;
20077 Ok(__struct)
20078 }
20079 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
20080 let mut __tmp = BytesMut::new(bytes);
20081 #[allow(clippy::absurd_extreme_comparisons)]
20082 #[allow(unused_comparisons)]
20083 if __tmp.remaining() < Self::ENCODED_LEN {
20084 panic!(
20085 "buffer is too small (need {} bytes, but got {})",
20086 Self::ENCODED_LEN,
20087 __tmp.remaining(),
20088 )
20089 }
20090 __tmp.put_u8(self.target_system);
20091 __tmp.put_u8(self.target_component);
20092 if matches!(version, MavlinkVersion::V2) {
20093 __tmp.put_u8(self.mission_type as u8);
20094 let len = __tmp.len();
20095 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
20096 } else {
20097 __tmp.len()
20098 }
20099 }
20100}
20101#[doc = "Request a partial list of mission items from the system/component. <https://mavlink.io/en/services/mission.html>. If start and end index are the same, just send one waypoint."]
20102#[doc = ""]
20103#[doc = "ID: 37"]
20104#[derive(Debug, Clone, PartialEq)]
20105#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
20106#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
20107pub struct MISSION_REQUEST_PARTIAL_LIST_DATA {
20108 #[doc = "Start index"]
20109 pub start_index: i16,
20110 #[doc = "End index, -1 by default (-1: send list to end). Else a valid index of the list"]
20111 pub end_index: i16,
20112 #[doc = "System ID"]
20113 pub target_system: u8,
20114 #[doc = "Component ID"]
20115 pub target_component: u8,
20116 #[doc = "Mission type."]
20117 #[cfg_attr(feature = "serde", serde(default))]
20118 pub mission_type: MavMissionType,
20119}
20120impl MISSION_REQUEST_PARTIAL_LIST_DATA {
20121 pub const ENCODED_LEN: usize = 7usize;
20122 pub const DEFAULT: Self = Self {
20123 start_index: 0_i16,
20124 end_index: 0_i16,
20125 target_system: 0_u8,
20126 target_component: 0_u8,
20127 mission_type: MavMissionType::DEFAULT,
20128 };
20129 #[cfg(feature = "arbitrary")]
20130 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
20131 use arbitrary::{Arbitrary, Unstructured};
20132 let mut buf = [0u8; 1024];
20133 rng.fill_bytes(&mut buf);
20134 let mut unstructured = Unstructured::new(&buf);
20135 Self::arbitrary(&mut unstructured).unwrap_or_default()
20136 }
20137}
20138impl Default for MISSION_REQUEST_PARTIAL_LIST_DATA {
20139 fn default() -> Self {
20140 Self::DEFAULT.clone()
20141 }
20142}
20143impl MessageData for MISSION_REQUEST_PARTIAL_LIST_DATA {
20144 type Message = MavMessage;
20145 const ID: u32 = 37u32;
20146 const NAME: &'static str = "MISSION_REQUEST_PARTIAL_LIST";
20147 const EXTRA_CRC: u8 = 212u8;
20148 const ENCODED_LEN: usize = 7usize;
20149 fn deser(
20150 _version: MavlinkVersion,
20151 __input: &[u8],
20152 ) -> Result<Self, ::mavlink_core::error::ParserError> {
20153 let avail_len = __input.len();
20154 let mut payload_buf = [0; Self::ENCODED_LEN];
20155 let mut buf = if avail_len < Self::ENCODED_LEN {
20156 payload_buf[0..avail_len].copy_from_slice(__input);
20157 Bytes::new(&payload_buf)
20158 } else {
20159 Bytes::new(__input)
20160 };
20161 let mut __struct = Self::default();
20162 __struct.start_index = buf.get_i16_le();
20163 __struct.end_index = buf.get_i16_le();
20164 __struct.target_system = buf.get_u8();
20165 __struct.target_component = buf.get_u8();
20166 let tmp = buf.get_u8();
20167 __struct.mission_type =
20168 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
20169 enum_type: "MavMissionType",
20170 value: tmp as u32,
20171 })?;
20172 Ok(__struct)
20173 }
20174 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
20175 let mut __tmp = BytesMut::new(bytes);
20176 #[allow(clippy::absurd_extreme_comparisons)]
20177 #[allow(unused_comparisons)]
20178 if __tmp.remaining() < Self::ENCODED_LEN {
20179 panic!(
20180 "buffer is too small (need {} bytes, but got {})",
20181 Self::ENCODED_LEN,
20182 __tmp.remaining(),
20183 )
20184 }
20185 __tmp.put_i16_le(self.start_index);
20186 __tmp.put_i16_le(self.end_index);
20187 __tmp.put_u8(self.target_system);
20188 __tmp.put_u8(self.target_component);
20189 if matches!(version, MavlinkVersion::V2) {
20190 __tmp.put_u8(self.mission_type as u8);
20191 let len = __tmp.len();
20192 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
20193 } else {
20194 __tmp.len()
20195 }
20196 }
20197}
20198#[deprecated = " See `MAV_CMD_DO_SET_MISSION_CURRENT` (Deprecated since 2022-08)"]
20199#[doc = "Set the mission item with sequence number seq as the current item and emit MISSION_CURRENT (whether or not the mission number changed). If a mission is currently being executed, the system will continue to this new mission item on the shortest path, skipping any intermediate mission items. Note that mission jump repeat counters are not reset (see MAV_CMD_DO_JUMP param2). This message may trigger a mission state-machine change on some systems: for example from MISSION_STATE_NOT_STARTED or MISSION_STATE_PAUSED to MISSION_STATE_ACTIVE. If the system is in mission mode, on those systems this command might therefore start, restart or resume the mission. If the system is not in mission mode this message must not trigger a switch to mission mode."]
20200#[doc = ""]
20201#[doc = "ID: 41"]
20202#[derive(Debug, Clone, PartialEq)]
20203#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
20204#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
20205pub struct MISSION_SET_CURRENT_DATA {
20206 #[doc = "Sequence"]
20207 pub seq: u16,
20208 #[doc = "System ID"]
20209 pub target_system: u8,
20210 #[doc = "Component ID"]
20211 pub target_component: u8,
20212}
20213impl MISSION_SET_CURRENT_DATA {
20214 pub const ENCODED_LEN: usize = 4usize;
20215 pub const DEFAULT: Self = Self {
20216 seq: 0_u16,
20217 target_system: 0_u8,
20218 target_component: 0_u8,
20219 };
20220 #[cfg(feature = "arbitrary")]
20221 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
20222 use arbitrary::{Arbitrary, Unstructured};
20223 let mut buf = [0u8; 1024];
20224 rng.fill_bytes(&mut buf);
20225 let mut unstructured = Unstructured::new(&buf);
20226 Self::arbitrary(&mut unstructured).unwrap_or_default()
20227 }
20228}
20229impl Default for MISSION_SET_CURRENT_DATA {
20230 fn default() -> Self {
20231 Self::DEFAULT.clone()
20232 }
20233}
20234impl MessageData for MISSION_SET_CURRENT_DATA {
20235 type Message = MavMessage;
20236 const ID: u32 = 41u32;
20237 const NAME: &'static str = "MISSION_SET_CURRENT";
20238 const EXTRA_CRC: u8 = 28u8;
20239 const ENCODED_LEN: usize = 4usize;
20240 fn deser(
20241 _version: MavlinkVersion,
20242 __input: &[u8],
20243 ) -> Result<Self, ::mavlink_core::error::ParserError> {
20244 let avail_len = __input.len();
20245 let mut payload_buf = [0; Self::ENCODED_LEN];
20246 let mut buf = if avail_len < Self::ENCODED_LEN {
20247 payload_buf[0..avail_len].copy_from_slice(__input);
20248 Bytes::new(&payload_buf)
20249 } else {
20250 Bytes::new(__input)
20251 };
20252 let mut __struct = Self::default();
20253 __struct.seq = buf.get_u16_le();
20254 __struct.target_system = buf.get_u8();
20255 __struct.target_component = buf.get_u8();
20256 Ok(__struct)
20257 }
20258 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
20259 let mut __tmp = BytesMut::new(bytes);
20260 #[allow(clippy::absurd_extreme_comparisons)]
20261 #[allow(unused_comparisons)]
20262 if __tmp.remaining() < Self::ENCODED_LEN {
20263 panic!(
20264 "buffer is too small (need {} bytes, but got {})",
20265 Self::ENCODED_LEN,
20266 __tmp.remaining(),
20267 )
20268 }
20269 __tmp.put_u16_le(self.seq);
20270 __tmp.put_u8(self.target_system);
20271 __tmp.put_u8(self.target_component);
20272 if matches!(version, MavlinkVersion::V2) {
20273 let len = __tmp.len();
20274 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
20275 } else {
20276 __tmp.len()
20277 }
20278 }
20279}
20280#[doc = "This message is sent to the MAV to write a partial list. If start index == end index, only one item will be transmitted / updated. If the start index is NOT 0 and above the current list size, this request should be REJECTED!."]
20281#[doc = ""]
20282#[doc = "ID: 38"]
20283#[derive(Debug, Clone, PartialEq)]
20284#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
20285#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
20286pub struct MISSION_WRITE_PARTIAL_LIST_DATA {
20287 #[doc = "Start index. Must be smaller / equal to the largest index of the current onboard list."]
20288 pub start_index: i16,
20289 #[doc = "End index, equal or greater than start index."]
20290 pub end_index: i16,
20291 #[doc = "System ID"]
20292 pub target_system: u8,
20293 #[doc = "Component ID"]
20294 pub target_component: u8,
20295 #[doc = "Mission type."]
20296 #[cfg_attr(feature = "serde", serde(default))]
20297 pub mission_type: MavMissionType,
20298}
20299impl MISSION_WRITE_PARTIAL_LIST_DATA {
20300 pub const ENCODED_LEN: usize = 7usize;
20301 pub const DEFAULT: Self = Self {
20302 start_index: 0_i16,
20303 end_index: 0_i16,
20304 target_system: 0_u8,
20305 target_component: 0_u8,
20306 mission_type: MavMissionType::DEFAULT,
20307 };
20308 #[cfg(feature = "arbitrary")]
20309 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
20310 use arbitrary::{Arbitrary, Unstructured};
20311 let mut buf = [0u8; 1024];
20312 rng.fill_bytes(&mut buf);
20313 let mut unstructured = Unstructured::new(&buf);
20314 Self::arbitrary(&mut unstructured).unwrap_or_default()
20315 }
20316}
20317impl Default for MISSION_WRITE_PARTIAL_LIST_DATA {
20318 fn default() -> Self {
20319 Self::DEFAULT.clone()
20320 }
20321}
20322impl MessageData for MISSION_WRITE_PARTIAL_LIST_DATA {
20323 type Message = MavMessage;
20324 const ID: u32 = 38u32;
20325 const NAME: &'static str = "MISSION_WRITE_PARTIAL_LIST";
20326 const EXTRA_CRC: u8 = 9u8;
20327 const ENCODED_LEN: usize = 7usize;
20328 fn deser(
20329 _version: MavlinkVersion,
20330 __input: &[u8],
20331 ) -> Result<Self, ::mavlink_core::error::ParserError> {
20332 let avail_len = __input.len();
20333 let mut payload_buf = [0; Self::ENCODED_LEN];
20334 let mut buf = if avail_len < Self::ENCODED_LEN {
20335 payload_buf[0..avail_len].copy_from_slice(__input);
20336 Bytes::new(&payload_buf)
20337 } else {
20338 Bytes::new(__input)
20339 };
20340 let mut __struct = Self::default();
20341 __struct.start_index = buf.get_i16_le();
20342 __struct.end_index = buf.get_i16_le();
20343 __struct.target_system = buf.get_u8();
20344 __struct.target_component = buf.get_u8();
20345 let tmp = buf.get_u8();
20346 __struct.mission_type =
20347 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
20348 enum_type: "MavMissionType",
20349 value: tmp as u32,
20350 })?;
20351 Ok(__struct)
20352 }
20353 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
20354 let mut __tmp = BytesMut::new(bytes);
20355 #[allow(clippy::absurd_extreme_comparisons)]
20356 #[allow(unused_comparisons)]
20357 if __tmp.remaining() < Self::ENCODED_LEN {
20358 panic!(
20359 "buffer is too small (need {} bytes, but got {})",
20360 Self::ENCODED_LEN,
20361 __tmp.remaining(),
20362 )
20363 }
20364 __tmp.put_i16_le(self.start_index);
20365 __tmp.put_i16_le(self.end_index);
20366 __tmp.put_u8(self.target_system);
20367 __tmp.put_u8(self.target_component);
20368 if matches!(version, MavlinkVersion::V2) {
20369 __tmp.put_u8(self.mission_type as u8);
20370 let len = __tmp.len();
20371 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
20372 } else {
20373 __tmp.len()
20374 }
20375 }
20376}
20377#[deprecated = "This message is being superseded by MAV_CMD_DO_GIMBAL_MANAGER_PITCHYAW. The message can still be used to communicate with legacy gimbals implementing it. See `MAV_CMD_DO_GIMBAL_MANAGER_PITCHYAW` (Deprecated since 2020-01)"]
20378#[doc = "Orientation of a mount."]
20379#[doc = ""]
20380#[doc = "ID: 265"]
20381#[derive(Debug, Clone, PartialEq)]
20382#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
20383#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
20384pub struct MOUNT_ORIENTATION_DATA {
20385 #[doc = "Timestamp (time since system boot)."]
20386 pub time_boot_ms: u32,
20387 #[doc = "Roll in global frame (set to NaN for invalid)."]
20388 pub roll: f32,
20389 #[doc = "Pitch in global frame (set to NaN for invalid)."]
20390 pub pitch: f32,
20391 #[doc = "Yaw relative to vehicle (set to NaN for invalid)."]
20392 pub yaw: f32,
20393 #[doc = "Yaw in absolute frame relative to Earth's North, north is 0 (set to NaN for invalid)."]
20394 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
20395 pub yaw_absolute: f32,
20396}
20397impl MOUNT_ORIENTATION_DATA {
20398 pub const ENCODED_LEN: usize = 20usize;
20399 pub const DEFAULT: Self = Self {
20400 time_boot_ms: 0_u32,
20401 roll: 0.0_f32,
20402 pitch: 0.0_f32,
20403 yaw: 0.0_f32,
20404 yaw_absolute: 0.0_f32,
20405 };
20406 #[cfg(feature = "arbitrary")]
20407 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
20408 use arbitrary::{Arbitrary, Unstructured};
20409 let mut buf = [0u8; 1024];
20410 rng.fill_bytes(&mut buf);
20411 let mut unstructured = Unstructured::new(&buf);
20412 Self::arbitrary(&mut unstructured).unwrap_or_default()
20413 }
20414}
20415impl Default for MOUNT_ORIENTATION_DATA {
20416 fn default() -> Self {
20417 Self::DEFAULT.clone()
20418 }
20419}
20420impl MessageData for MOUNT_ORIENTATION_DATA {
20421 type Message = MavMessage;
20422 const ID: u32 = 265u32;
20423 const NAME: &'static str = "MOUNT_ORIENTATION";
20424 const EXTRA_CRC: u8 = 26u8;
20425 const ENCODED_LEN: usize = 20usize;
20426 fn deser(
20427 _version: MavlinkVersion,
20428 __input: &[u8],
20429 ) -> Result<Self, ::mavlink_core::error::ParserError> {
20430 let avail_len = __input.len();
20431 let mut payload_buf = [0; Self::ENCODED_LEN];
20432 let mut buf = if avail_len < Self::ENCODED_LEN {
20433 payload_buf[0..avail_len].copy_from_slice(__input);
20434 Bytes::new(&payload_buf)
20435 } else {
20436 Bytes::new(__input)
20437 };
20438 let mut __struct = Self::default();
20439 __struct.time_boot_ms = buf.get_u32_le();
20440 __struct.roll = buf.get_f32_le();
20441 __struct.pitch = buf.get_f32_le();
20442 __struct.yaw = buf.get_f32_le();
20443 __struct.yaw_absolute = buf.get_f32_le();
20444 Ok(__struct)
20445 }
20446 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
20447 let mut __tmp = BytesMut::new(bytes);
20448 #[allow(clippy::absurd_extreme_comparisons)]
20449 #[allow(unused_comparisons)]
20450 if __tmp.remaining() < Self::ENCODED_LEN {
20451 panic!(
20452 "buffer is too small (need {} bytes, but got {})",
20453 Self::ENCODED_LEN,
20454 __tmp.remaining(),
20455 )
20456 }
20457 __tmp.put_u32_le(self.time_boot_ms);
20458 __tmp.put_f32_le(self.roll);
20459 __tmp.put_f32_le(self.pitch);
20460 __tmp.put_f32_le(self.yaw);
20461 if matches!(version, MavlinkVersion::V2) {
20462 __tmp.put_f32_le(self.yaw_absolute);
20463 let len = __tmp.len();
20464 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
20465 } else {
20466 __tmp.len()
20467 }
20468 }
20469}
20470#[doc = "Send a key-value pair as float. The use of this message is discouraged for normal packets, but a quite efficient way for testing new messages and getting experimental debug output."]
20471#[doc = ""]
20472#[doc = "ID: 251"]
20473#[derive(Debug, Clone, PartialEq)]
20474#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
20475#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
20476pub struct NAMED_VALUE_FLOAT_DATA {
20477 #[doc = "Timestamp (time since system boot)."]
20478 pub time_boot_ms: u32,
20479 #[doc = "Floating point value"]
20480 pub value: f32,
20481 #[doc = "Name of the debug variable"]
20482 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
20483 pub name: [u8; 10],
20484}
20485impl NAMED_VALUE_FLOAT_DATA {
20486 pub const ENCODED_LEN: usize = 18usize;
20487 pub const DEFAULT: Self = Self {
20488 time_boot_ms: 0_u32,
20489 value: 0.0_f32,
20490 name: [0_u8; 10usize],
20491 };
20492 #[cfg(feature = "arbitrary")]
20493 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
20494 use arbitrary::{Arbitrary, Unstructured};
20495 let mut buf = [0u8; 1024];
20496 rng.fill_bytes(&mut buf);
20497 let mut unstructured = Unstructured::new(&buf);
20498 Self::arbitrary(&mut unstructured).unwrap_or_default()
20499 }
20500}
20501impl Default for NAMED_VALUE_FLOAT_DATA {
20502 fn default() -> Self {
20503 Self::DEFAULT.clone()
20504 }
20505}
20506impl MessageData for NAMED_VALUE_FLOAT_DATA {
20507 type Message = MavMessage;
20508 const ID: u32 = 251u32;
20509 const NAME: &'static str = "NAMED_VALUE_FLOAT";
20510 const EXTRA_CRC: u8 = 170u8;
20511 const ENCODED_LEN: usize = 18usize;
20512 fn deser(
20513 _version: MavlinkVersion,
20514 __input: &[u8],
20515 ) -> Result<Self, ::mavlink_core::error::ParserError> {
20516 let avail_len = __input.len();
20517 let mut payload_buf = [0; Self::ENCODED_LEN];
20518 let mut buf = if avail_len < Self::ENCODED_LEN {
20519 payload_buf[0..avail_len].copy_from_slice(__input);
20520 Bytes::new(&payload_buf)
20521 } else {
20522 Bytes::new(__input)
20523 };
20524 let mut __struct = Self::default();
20525 __struct.time_boot_ms = buf.get_u32_le();
20526 __struct.value = buf.get_f32_le();
20527 for v in &mut __struct.name {
20528 let val = buf.get_u8();
20529 *v = val;
20530 }
20531 Ok(__struct)
20532 }
20533 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
20534 let mut __tmp = BytesMut::new(bytes);
20535 #[allow(clippy::absurd_extreme_comparisons)]
20536 #[allow(unused_comparisons)]
20537 if __tmp.remaining() < Self::ENCODED_LEN {
20538 panic!(
20539 "buffer is too small (need {} bytes, but got {})",
20540 Self::ENCODED_LEN,
20541 __tmp.remaining(),
20542 )
20543 }
20544 __tmp.put_u32_le(self.time_boot_ms);
20545 __tmp.put_f32_le(self.value);
20546 for val in &self.name {
20547 __tmp.put_u8(*val);
20548 }
20549 if matches!(version, MavlinkVersion::V2) {
20550 let len = __tmp.len();
20551 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
20552 } else {
20553 __tmp.len()
20554 }
20555 }
20556}
20557#[doc = "Send a key-value pair as integer. The use of this message is discouraged for normal packets, but a quite efficient way for testing new messages and getting experimental debug output."]
20558#[doc = ""]
20559#[doc = "ID: 252"]
20560#[derive(Debug, Clone, PartialEq)]
20561#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
20562#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
20563pub struct NAMED_VALUE_INT_DATA {
20564 #[doc = "Timestamp (time since system boot)."]
20565 pub time_boot_ms: u32,
20566 #[doc = "Signed integer value"]
20567 pub value: i32,
20568 #[doc = "Name of the debug variable"]
20569 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
20570 pub name: [u8; 10],
20571}
20572impl NAMED_VALUE_INT_DATA {
20573 pub const ENCODED_LEN: usize = 18usize;
20574 pub const DEFAULT: Self = Self {
20575 time_boot_ms: 0_u32,
20576 value: 0_i32,
20577 name: [0_u8; 10usize],
20578 };
20579 #[cfg(feature = "arbitrary")]
20580 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
20581 use arbitrary::{Arbitrary, Unstructured};
20582 let mut buf = [0u8; 1024];
20583 rng.fill_bytes(&mut buf);
20584 let mut unstructured = Unstructured::new(&buf);
20585 Self::arbitrary(&mut unstructured).unwrap_or_default()
20586 }
20587}
20588impl Default for NAMED_VALUE_INT_DATA {
20589 fn default() -> Self {
20590 Self::DEFAULT.clone()
20591 }
20592}
20593impl MessageData for NAMED_VALUE_INT_DATA {
20594 type Message = MavMessage;
20595 const ID: u32 = 252u32;
20596 const NAME: &'static str = "NAMED_VALUE_INT";
20597 const EXTRA_CRC: u8 = 44u8;
20598 const ENCODED_LEN: usize = 18usize;
20599 fn deser(
20600 _version: MavlinkVersion,
20601 __input: &[u8],
20602 ) -> Result<Self, ::mavlink_core::error::ParserError> {
20603 let avail_len = __input.len();
20604 let mut payload_buf = [0; Self::ENCODED_LEN];
20605 let mut buf = if avail_len < Self::ENCODED_LEN {
20606 payload_buf[0..avail_len].copy_from_slice(__input);
20607 Bytes::new(&payload_buf)
20608 } else {
20609 Bytes::new(__input)
20610 };
20611 let mut __struct = Self::default();
20612 __struct.time_boot_ms = buf.get_u32_le();
20613 __struct.value = buf.get_i32_le();
20614 for v in &mut __struct.name {
20615 let val = buf.get_u8();
20616 *v = val;
20617 }
20618 Ok(__struct)
20619 }
20620 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
20621 let mut __tmp = BytesMut::new(bytes);
20622 #[allow(clippy::absurd_extreme_comparisons)]
20623 #[allow(unused_comparisons)]
20624 if __tmp.remaining() < Self::ENCODED_LEN {
20625 panic!(
20626 "buffer is too small (need {} bytes, but got {})",
20627 Self::ENCODED_LEN,
20628 __tmp.remaining(),
20629 )
20630 }
20631 __tmp.put_u32_le(self.time_boot_ms);
20632 __tmp.put_i32_le(self.value);
20633 for val in &self.name {
20634 __tmp.put_u8(*val);
20635 }
20636 if matches!(version, MavlinkVersion::V2) {
20637 let len = __tmp.len();
20638 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
20639 } else {
20640 __tmp.len()
20641 }
20642 }
20643}
20644#[doc = "The state of the navigation and position controller."]
20645#[doc = ""]
20646#[doc = "ID: 62"]
20647#[derive(Debug, Clone, PartialEq)]
20648#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
20649#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
20650pub struct NAV_CONTROLLER_OUTPUT_DATA {
20651 #[doc = "Current desired roll"]
20652 pub nav_roll: f32,
20653 #[doc = "Current desired pitch"]
20654 pub nav_pitch: f32,
20655 #[doc = "Current altitude error"]
20656 pub alt_error: f32,
20657 #[doc = "Current airspeed error"]
20658 pub aspd_error: f32,
20659 #[doc = "Current crosstrack error on x-y plane"]
20660 pub xtrack_error: f32,
20661 #[doc = "Current desired heading"]
20662 pub nav_bearing: i16,
20663 #[doc = "Bearing to current waypoint/target"]
20664 pub target_bearing: i16,
20665 #[doc = "Distance to active waypoint"]
20666 pub wp_dist: u16,
20667}
20668impl NAV_CONTROLLER_OUTPUT_DATA {
20669 pub const ENCODED_LEN: usize = 26usize;
20670 pub const DEFAULT: Self = Self {
20671 nav_roll: 0.0_f32,
20672 nav_pitch: 0.0_f32,
20673 alt_error: 0.0_f32,
20674 aspd_error: 0.0_f32,
20675 xtrack_error: 0.0_f32,
20676 nav_bearing: 0_i16,
20677 target_bearing: 0_i16,
20678 wp_dist: 0_u16,
20679 };
20680 #[cfg(feature = "arbitrary")]
20681 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
20682 use arbitrary::{Arbitrary, Unstructured};
20683 let mut buf = [0u8; 1024];
20684 rng.fill_bytes(&mut buf);
20685 let mut unstructured = Unstructured::new(&buf);
20686 Self::arbitrary(&mut unstructured).unwrap_or_default()
20687 }
20688}
20689impl Default for NAV_CONTROLLER_OUTPUT_DATA {
20690 fn default() -> Self {
20691 Self::DEFAULT.clone()
20692 }
20693}
20694impl MessageData for NAV_CONTROLLER_OUTPUT_DATA {
20695 type Message = MavMessage;
20696 const ID: u32 = 62u32;
20697 const NAME: &'static str = "NAV_CONTROLLER_OUTPUT";
20698 const EXTRA_CRC: u8 = 183u8;
20699 const ENCODED_LEN: usize = 26usize;
20700 fn deser(
20701 _version: MavlinkVersion,
20702 __input: &[u8],
20703 ) -> Result<Self, ::mavlink_core::error::ParserError> {
20704 let avail_len = __input.len();
20705 let mut payload_buf = [0; Self::ENCODED_LEN];
20706 let mut buf = if avail_len < Self::ENCODED_LEN {
20707 payload_buf[0..avail_len].copy_from_slice(__input);
20708 Bytes::new(&payload_buf)
20709 } else {
20710 Bytes::new(__input)
20711 };
20712 let mut __struct = Self::default();
20713 __struct.nav_roll = buf.get_f32_le();
20714 __struct.nav_pitch = buf.get_f32_le();
20715 __struct.alt_error = buf.get_f32_le();
20716 __struct.aspd_error = buf.get_f32_le();
20717 __struct.xtrack_error = buf.get_f32_le();
20718 __struct.nav_bearing = buf.get_i16_le();
20719 __struct.target_bearing = buf.get_i16_le();
20720 __struct.wp_dist = buf.get_u16_le();
20721 Ok(__struct)
20722 }
20723 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
20724 let mut __tmp = BytesMut::new(bytes);
20725 #[allow(clippy::absurd_extreme_comparisons)]
20726 #[allow(unused_comparisons)]
20727 if __tmp.remaining() < Self::ENCODED_LEN {
20728 panic!(
20729 "buffer is too small (need {} bytes, but got {})",
20730 Self::ENCODED_LEN,
20731 __tmp.remaining(),
20732 )
20733 }
20734 __tmp.put_f32_le(self.nav_roll);
20735 __tmp.put_f32_le(self.nav_pitch);
20736 __tmp.put_f32_le(self.alt_error);
20737 __tmp.put_f32_le(self.aspd_error);
20738 __tmp.put_f32_le(self.xtrack_error);
20739 __tmp.put_i16_le(self.nav_bearing);
20740 __tmp.put_i16_le(self.target_bearing);
20741 __tmp.put_u16_le(self.wp_dist);
20742 if matches!(version, MavlinkVersion::V2) {
20743 let len = __tmp.len();
20744 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
20745 } else {
20746 __tmp.len()
20747 }
20748 }
20749}
20750#[doc = "Obstacle distances in front of the sensor, starting from the left in increment degrees to the right."]
20751#[doc = ""]
20752#[doc = "ID: 330"]
20753#[derive(Debug, Clone, PartialEq)]
20754#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
20755#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
20756pub struct OBSTACLE_DISTANCE_DATA {
20757 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
20758 pub time_usec: u64,
20759 #[doc = "Distance of obstacles around the vehicle with index 0 corresponding to north + angle_offset, unless otherwise specified in the frame. A value of 0 is valid and means that the obstacle is practically touching the sensor. A value of max_distance +1 means no obstacle is present. A value of UINT16_MAX for unknown/not used. In a array element, one unit corresponds to 1cm."]
20760 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
20761 pub distances: [u16; 72],
20762 #[doc = "Minimum distance the sensor can measure."]
20763 pub min_distance: u16,
20764 #[doc = "Maximum distance the sensor can measure."]
20765 pub max_distance: u16,
20766 #[doc = "Class id of the distance sensor type."]
20767 pub sensor_type: MavDistanceSensor,
20768 #[doc = "Angular width in degrees of each array element. Increment direction is clockwise. This field is ignored if increment_f is non-zero."]
20769 pub increment: u8,
20770 #[doc = "Angular width in degrees of each array element as a float. If non-zero then this value is used instead of the uint8_t increment field. Positive is clockwise direction, negative is counter-clockwise."]
20771 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
20772 pub increment_f: f32,
20773 #[doc = "Relative angle offset of the 0-index element in the distances array. Value of 0 corresponds to forward. Positive is clockwise direction, negative is counter-clockwise."]
20774 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
20775 pub angle_offset: f32,
20776 #[doc = "Coordinate frame of reference for the yaw rotation and offset of the sensor data. Defaults to MAV_FRAME_GLOBAL, which is north aligned. For body-mounted sensors use MAV_FRAME_BODY_FRD, which is vehicle front aligned."]
20777 #[cfg_attr(feature = "serde", serde(default))]
20778 pub frame: MavFrame,
20779}
20780impl OBSTACLE_DISTANCE_DATA {
20781 pub const ENCODED_LEN: usize = 167usize;
20782 pub const DEFAULT: Self = Self {
20783 time_usec: 0_u64,
20784 distances: [0_u16; 72usize],
20785 min_distance: 0_u16,
20786 max_distance: 0_u16,
20787 sensor_type: MavDistanceSensor::DEFAULT,
20788 increment: 0_u8,
20789 increment_f: 0.0_f32,
20790 angle_offset: 0.0_f32,
20791 frame: MavFrame::DEFAULT,
20792 };
20793 #[cfg(feature = "arbitrary")]
20794 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
20795 use arbitrary::{Arbitrary, Unstructured};
20796 let mut buf = [0u8; 1024];
20797 rng.fill_bytes(&mut buf);
20798 let mut unstructured = Unstructured::new(&buf);
20799 Self::arbitrary(&mut unstructured).unwrap_or_default()
20800 }
20801}
20802impl Default for OBSTACLE_DISTANCE_DATA {
20803 fn default() -> Self {
20804 Self::DEFAULT.clone()
20805 }
20806}
20807impl MessageData for OBSTACLE_DISTANCE_DATA {
20808 type Message = MavMessage;
20809 const ID: u32 = 330u32;
20810 const NAME: &'static str = "OBSTACLE_DISTANCE";
20811 const EXTRA_CRC: u8 = 23u8;
20812 const ENCODED_LEN: usize = 167usize;
20813 fn deser(
20814 _version: MavlinkVersion,
20815 __input: &[u8],
20816 ) -> Result<Self, ::mavlink_core::error::ParserError> {
20817 let avail_len = __input.len();
20818 let mut payload_buf = [0; Self::ENCODED_LEN];
20819 let mut buf = if avail_len < Self::ENCODED_LEN {
20820 payload_buf[0..avail_len].copy_from_slice(__input);
20821 Bytes::new(&payload_buf)
20822 } else {
20823 Bytes::new(__input)
20824 };
20825 let mut __struct = Self::default();
20826 __struct.time_usec = buf.get_u64_le();
20827 for v in &mut __struct.distances {
20828 let val = buf.get_u16_le();
20829 *v = val;
20830 }
20831 __struct.min_distance = buf.get_u16_le();
20832 __struct.max_distance = buf.get_u16_le();
20833 let tmp = buf.get_u8();
20834 __struct.sensor_type =
20835 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
20836 enum_type: "MavDistanceSensor",
20837 value: tmp as u32,
20838 })?;
20839 __struct.increment = buf.get_u8();
20840 __struct.increment_f = buf.get_f32_le();
20841 __struct.angle_offset = buf.get_f32_le();
20842 let tmp = buf.get_u8();
20843 __struct.frame =
20844 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
20845 enum_type: "MavFrame",
20846 value: tmp as u32,
20847 })?;
20848 Ok(__struct)
20849 }
20850 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
20851 let mut __tmp = BytesMut::new(bytes);
20852 #[allow(clippy::absurd_extreme_comparisons)]
20853 #[allow(unused_comparisons)]
20854 if __tmp.remaining() < Self::ENCODED_LEN {
20855 panic!(
20856 "buffer is too small (need {} bytes, but got {})",
20857 Self::ENCODED_LEN,
20858 __tmp.remaining(),
20859 )
20860 }
20861 __tmp.put_u64_le(self.time_usec);
20862 for val in &self.distances {
20863 __tmp.put_u16_le(*val);
20864 }
20865 __tmp.put_u16_le(self.min_distance);
20866 __tmp.put_u16_le(self.max_distance);
20867 __tmp.put_u8(self.sensor_type as u8);
20868 __tmp.put_u8(self.increment);
20869 if matches!(version, MavlinkVersion::V2) {
20870 __tmp.put_f32_le(self.increment_f);
20871 __tmp.put_f32_le(self.angle_offset);
20872 __tmp.put_u8(self.frame as u8);
20873 let len = __tmp.len();
20874 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
20875 } else {
20876 __tmp.len()
20877 }
20878 }
20879}
20880#[doc = "Odometry message to communicate odometry information with an external interface. Fits ROS REP 147 standard for aerial vehicles (<http://www.ros.org/reps/rep-0147.html>)."]
20881#[doc = ""]
20882#[doc = "ID: 331"]
20883#[derive(Debug, Clone, PartialEq)]
20884#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
20885#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
20886pub struct ODOMETRY_DATA {
20887 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
20888 pub time_usec: u64,
20889 #[doc = "X Position"]
20890 pub x: f32,
20891 #[doc = "Y Position"]
20892 pub y: f32,
20893 #[doc = "Z Position"]
20894 pub z: f32,
20895 #[doc = "Quaternion components, w, x, y, z (1 0 0 0 is the null-rotation)"]
20896 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
20897 pub q: [f32; 4],
20898 #[doc = "X linear speed"]
20899 pub vx: f32,
20900 #[doc = "Y linear speed"]
20901 pub vy: f32,
20902 #[doc = "Z linear speed"]
20903 pub vz: f32,
20904 #[doc = "Roll angular speed"]
20905 pub rollspeed: f32,
20906 #[doc = "Pitch angular speed"]
20907 pub pitchspeed: f32,
20908 #[doc = "Yaw angular speed"]
20909 pub yawspeed: f32,
20910 #[doc = "Row-major representation of a 6x6 pose cross-covariance matrix upper right triangle (states: x, y, z, roll, pitch, yaw; first six entries are the first ROW, next five entries are the second ROW, etc.). If unknown, assign NaN value to first element in the array."]
20911 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
20912 pub pose_covariance: [f32; 21],
20913 #[doc = "Row-major representation of a 6x6 velocity cross-covariance matrix upper right triangle (states: vx, vy, vz, rollspeed, pitchspeed, yawspeed; first six entries are the first ROW, next five entries are the second ROW, etc.). If unknown, assign NaN value to first element in the array."]
20914 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
20915 pub velocity_covariance: [f32; 21],
20916 #[doc = "Coordinate frame of reference for the pose data."]
20917 pub frame_id: MavFrame,
20918 #[doc = "Coordinate frame of reference for the velocity in free space (twist) data."]
20919 pub child_frame_id: MavFrame,
20920 #[doc = "Estimate reset counter. This should be incremented when the estimate resets in any of the dimensions (position, velocity, attitude, angular speed). This is designed to be used when e.g an external SLAM system detects a loop-closure and the estimate jumps."]
20921 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
20922 pub reset_counter: u8,
20923 #[doc = "Type of estimator that is providing the odometry."]
20924 #[cfg_attr(feature = "serde", serde(default))]
20925 pub estimator_type: MavEstimatorType,
20926 #[doc = "Optional odometry quality metric as a percentage. -1 = odometry has failed, 0 = unknown/unset quality, 1 = worst quality, 100 = best quality"]
20927 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
20928 pub quality: i8,
20929}
20930impl ODOMETRY_DATA {
20931 pub const ENCODED_LEN: usize = 233usize;
20932 pub const DEFAULT: Self = Self {
20933 time_usec: 0_u64,
20934 x: 0.0_f32,
20935 y: 0.0_f32,
20936 z: 0.0_f32,
20937 q: [0.0_f32; 4usize],
20938 vx: 0.0_f32,
20939 vy: 0.0_f32,
20940 vz: 0.0_f32,
20941 rollspeed: 0.0_f32,
20942 pitchspeed: 0.0_f32,
20943 yawspeed: 0.0_f32,
20944 pose_covariance: [0.0_f32; 21usize],
20945 velocity_covariance: [0.0_f32; 21usize],
20946 frame_id: MavFrame::DEFAULT,
20947 child_frame_id: MavFrame::DEFAULT,
20948 reset_counter: 0_u8,
20949 estimator_type: MavEstimatorType::DEFAULT,
20950 quality: 0_i8,
20951 };
20952 #[cfg(feature = "arbitrary")]
20953 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
20954 use arbitrary::{Arbitrary, Unstructured};
20955 let mut buf = [0u8; 1024];
20956 rng.fill_bytes(&mut buf);
20957 let mut unstructured = Unstructured::new(&buf);
20958 Self::arbitrary(&mut unstructured).unwrap_or_default()
20959 }
20960}
20961impl Default for ODOMETRY_DATA {
20962 fn default() -> Self {
20963 Self::DEFAULT.clone()
20964 }
20965}
20966impl MessageData for ODOMETRY_DATA {
20967 type Message = MavMessage;
20968 const ID: u32 = 331u32;
20969 const NAME: &'static str = "ODOMETRY";
20970 const EXTRA_CRC: u8 = 91u8;
20971 const ENCODED_LEN: usize = 233usize;
20972 fn deser(
20973 _version: MavlinkVersion,
20974 __input: &[u8],
20975 ) -> Result<Self, ::mavlink_core::error::ParserError> {
20976 let avail_len = __input.len();
20977 let mut payload_buf = [0; Self::ENCODED_LEN];
20978 let mut buf = if avail_len < Self::ENCODED_LEN {
20979 payload_buf[0..avail_len].copy_from_slice(__input);
20980 Bytes::new(&payload_buf)
20981 } else {
20982 Bytes::new(__input)
20983 };
20984 let mut __struct = Self::default();
20985 __struct.time_usec = buf.get_u64_le();
20986 __struct.x = buf.get_f32_le();
20987 __struct.y = buf.get_f32_le();
20988 __struct.z = buf.get_f32_le();
20989 for v in &mut __struct.q {
20990 let val = buf.get_f32_le();
20991 *v = val;
20992 }
20993 __struct.vx = buf.get_f32_le();
20994 __struct.vy = buf.get_f32_le();
20995 __struct.vz = buf.get_f32_le();
20996 __struct.rollspeed = buf.get_f32_le();
20997 __struct.pitchspeed = buf.get_f32_le();
20998 __struct.yawspeed = buf.get_f32_le();
20999 for v in &mut __struct.pose_covariance {
21000 let val = buf.get_f32_le();
21001 *v = val;
21002 }
21003 for v in &mut __struct.velocity_covariance {
21004 let val = buf.get_f32_le();
21005 *v = val;
21006 }
21007 let tmp = buf.get_u8();
21008 __struct.frame_id =
21009 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
21010 enum_type: "MavFrame",
21011 value: tmp as u32,
21012 })?;
21013 let tmp = buf.get_u8();
21014 __struct.child_frame_id =
21015 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
21016 enum_type: "MavFrame",
21017 value: tmp as u32,
21018 })?;
21019 __struct.reset_counter = buf.get_u8();
21020 let tmp = buf.get_u8();
21021 __struct.estimator_type =
21022 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
21023 enum_type: "MavEstimatorType",
21024 value: tmp as u32,
21025 })?;
21026 __struct.quality = buf.get_i8();
21027 Ok(__struct)
21028 }
21029 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
21030 let mut __tmp = BytesMut::new(bytes);
21031 #[allow(clippy::absurd_extreme_comparisons)]
21032 #[allow(unused_comparisons)]
21033 if __tmp.remaining() < Self::ENCODED_LEN {
21034 panic!(
21035 "buffer is too small (need {} bytes, but got {})",
21036 Self::ENCODED_LEN,
21037 __tmp.remaining(),
21038 )
21039 }
21040 __tmp.put_u64_le(self.time_usec);
21041 __tmp.put_f32_le(self.x);
21042 __tmp.put_f32_le(self.y);
21043 __tmp.put_f32_le(self.z);
21044 for val in &self.q {
21045 __tmp.put_f32_le(*val);
21046 }
21047 __tmp.put_f32_le(self.vx);
21048 __tmp.put_f32_le(self.vy);
21049 __tmp.put_f32_le(self.vz);
21050 __tmp.put_f32_le(self.rollspeed);
21051 __tmp.put_f32_le(self.pitchspeed);
21052 __tmp.put_f32_le(self.yawspeed);
21053 for val in &self.pose_covariance {
21054 __tmp.put_f32_le(*val);
21055 }
21056 for val in &self.velocity_covariance {
21057 __tmp.put_f32_le(*val);
21058 }
21059 __tmp.put_u8(self.frame_id as u8);
21060 __tmp.put_u8(self.child_frame_id as u8);
21061 if matches!(version, MavlinkVersion::V2) {
21062 __tmp.put_u8(self.reset_counter);
21063 __tmp.put_u8(self.estimator_type as u8);
21064 __tmp.put_i8(self.quality);
21065 let len = __tmp.len();
21066 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
21067 } else {
21068 __tmp.len()
21069 }
21070 }
21071}
21072#[doc = "Hardware status sent by an onboard computer."]
21073#[doc = ""]
21074#[doc = "ID: 390"]
21075#[derive(Debug, Clone, PartialEq)]
21076#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
21077#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
21078pub struct ONBOARD_COMPUTER_STATUS_DATA {
21079 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
21080 pub time_usec: u64,
21081 #[doc = "Time since system boot."]
21082 pub uptime: u32,
21083 #[doc = "Amount of used RAM on the component system. A value of UINT32_MAX implies the field is unused."]
21084 pub ram_usage: u32,
21085 #[doc = "Total amount of RAM on the component system. A value of UINT32_MAX implies the field is unused."]
21086 pub ram_total: u32,
21087 #[doc = "Storage type: 0: HDD, 1: SSD, 2: EMMC, 3: SD card (non-removable), 4: SD card (removable). A value of UINT32_MAX implies the field is unused."]
21088 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
21089 pub storage_type: [u32; 4],
21090 #[doc = "Amount of used storage space on the component system. A value of UINT32_MAX implies the field is unused."]
21091 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
21092 pub storage_usage: [u32; 4],
21093 #[doc = "Total amount of storage space on the component system. A value of UINT32_MAX implies the field is unused."]
21094 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
21095 pub storage_total: [u32; 4],
21096 #[doc = "Link type: 0-9: UART, 10-19: Wired network, 20-29: Wifi, 30-39: Point-to-point proprietary, 40-49: Mesh proprietary"]
21097 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
21098 pub link_type: [u32; 6],
21099 #[doc = "Network traffic from the component system. A value of UINT32_MAX implies the field is unused."]
21100 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
21101 pub link_tx_rate: [u32; 6],
21102 #[doc = "Network traffic to the component system. A value of UINT32_MAX implies the field is unused."]
21103 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
21104 pub link_rx_rate: [u32; 6],
21105 #[doc = "Network capacity from the component system. A value of UINT32_MAX implies the field is unused."]
21106 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
21107 pub link_tx_max: [u32; 6],
21108 #[doc = "Network capacity to the component system. A value of UINT32_MAX implies the field is unused."]
21109 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
21110 pub link_rx_max: [u32; 6],
21111 #[doc = "Fan speeds. A value of INT16_MAX implies the field is unused."]
21112 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
21113 pub fan_speed: [i16; 4],
21114 #[doc = "Type of the onboard computer: 0: Mission computer primary, 1: Mission computer backup 1, 2: Mission computer backup 2, 3: Compute node, 4-5: Compute spares, 6-9: Payload computers."]
21115 pub mavtype: u8,
21116 #[doc = "CPU usage on the component in percent (100 - idle). A value of UINT8_MAX implies the field is unused."]
21117 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
21118 pub cpu_cores: [u8; 8],
21119 #[doc = "Combined CPU usage as the last 10 slices of 100 MS (a histogram). This allows to identify spikes in load that max out the system, but only for a short amount of time. A value of UINT8_MAX implies the field is unused."]
21120 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
21121 pub cpu_combined: [u8; 10],
21122 #[doc = "GPU usage on the component in percent (100 - idle). A value of UINT8_MAX implies the field is unused."]
21123 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
21124 pub gpu_cores: [u8; 4],
21125 #[doc = "Combined GPU usage as the last 10 slices of 100 MS (a histogram). This allows to identify spikes in load that max out the system, but only for a short amount of time. A value of UINT8_MAX implies the field is unused."]
21126 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
21127 pub gpu_combined: [u8; 10],
21128 #[doc = "Temperature of the board. A value of INT8_MAX implies the field is unused."]
21129 pub temperature_board: i8,
21130 #[doc = "Temperature of the CPU core. A value of INT8_MAX implies the field is unused."]
21131 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
21132 pub temperature_core: [i8; 8],
21133}
21134impl ONBOARD_COMPUTER_STATUS_DATA {
21135 pub const ENCODED_LEN: usize = 238usize;
21136 pub const DEFAULT: Self = Self {
21137 time_usec: 0_u64,
21138 uptime: 0_u32,
21139 ram_usage: 0_u32,
21140 ram_total: 0_u32,
21141 storage_type: [0_u32; 4usize],
21142 storage_usage: [0_u32; 4usize],
21143 storage_total: [0_u32; 4usize],
21144 link_type: [0_u32; 6usize],
21145 link_tx_rate: [0_u32; 6usize],
21146 link_rx_rate: [0_u32; 6usize],
21147 link_tx_max: [0_u32; 6usize],
21148 link_rx_max: [0_u32; 6usize],
21149 fan_speed: [0_i16; 4usize],
21150 mavtype: 0_u8,
21151 cpu_cores: [0_u8; 8usize],
21152 cpu_combined: [0_u8; 10usize],
21153 gpu_cores: [0_u8; 4usize],
21154 gpu_combined: [0_u8; 10usize],
21155 temperature_board: 0_i8,
21156 temperature_core: [0_i8; 8usize],
21157 };
21158 #[cfg(feature = "arbitrary")]
21159 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
21160 use arbitrary::{Arbitrary, Unstructured};
21161 let mut buf = [0u8; 1024];
21162 rng.fill_bytes(&mut buf);
21163 let mut unstructured = Unstructured::new(&buf);
21164 Self::arbitrary(&mut unstructured).unwrap_or_default()
21165 }
21166}
21167impl Default for ONBOARD_COMPUTER_STATUS_DATA {
21168 fn default() -> Self {
21169 Self::DEFAULT.clone()
21170 }
21171}
21172impl MessageData for ONBOARD_COMPUTER_STATUS_DATA {
21173 type Message = MavMessage;
21174 const ID: u32 = 390u32;
21175 const NAME: &'static str = "ONBOARD_COMPUTER_STATUS";
21176 const EXTRA_CRC: u8 = 156u8;
21177 const ENCODED_LEN: usize = 238usize;
21178 fn deser(
21179 _version: MavlinkVersion,
21180 __input: &[u8],
21181 ) -> Result<Self, ::mavlink_core::error::ParserError> {
21182 let avail_len = __input.len();
21183 let mut payload_buf = [0; Self::ENCODED_LEN];
21184 let mut buf = if avail_len < Self::ENCODED_LEN {
21185 payload_buf[0..avail_len].copy_from_slice(__input);
21186 Bytes::new(&payload_buf)
21187 } else {
21188 Bytes::new(__input)
21189 };
21190 let mut __struct = Self::default();
21191 __struct.time_usec = buf.get_u64_le();
21192 __struct.uptime = buf.get_u32_le();
21193 __struct.ram_usage = buf.get_u32_le();
21194 __struct.ram_total = buf.get_u32_le();
21195 for v in &mut __struct.storage_type {
21196 let val = buf.get_u32_le();
21197 *v = val;
21198 }
21199 for v in &mut __struct.storage_usage {
21200 let val = buf.get_u32_le();
21201 *v = val;
21202 }
21203 for v in &mut __struct.storage_total {
21204 let val = buf.get_u32_le();
21205 *v = val;
21206 }
21207 for v in &mut __struct.link_type {
21208 let val = buf.get_u32_le();
21209 *v = val;
21210 }
21211 for v in &mut __struct.link_tx_rate {
21212 let val = buf.get_u32_le();
21213 *v = val;
21214 }
21215 for v in &mut __struct.link_rx_rate {
21216 let val = buf.get_u32_le();
21217 *v = val;
21218 }
21219 for v in &mut __struct.link_tx_max {
21220 let val = buf.get_u32_le();
21221 *v = val;
21222 }
21223 for v in &mut __struct.link_rx_max {
21224 let val = buf.get_u32_le();
21225 *v = val;
21226 }
21227 for v in &mut __struct.fan_speed {
21228 let val = buf.get_i16_le();
21229 *v = val;
21230 }
21231 __struct.mavtype = buf.get_u8();
21232 for v in &mut __struct.cpu_cores {
21233 let val = buf.get_u8();
21234 *v = val;
21235 }
21236 for v in &mut __struct.cpu_combined {
21237 let val = buf.get_u8();
21238 *v = val;
21239 }
21240 for v in &mut __struct.gpu_cores {
21241 let val = buf.get_u8();
21242 *v = val;
21243 }
21244 for v in &mut __struct.gpu_combined {
21245 let val = buf.get_u8();
21246 *v = val;
21247 }
21248 __struct.temperature_board = buf.get_i8();
21249 for v in &mut __struct.temperature_core {
21250 let val = buf.get_i8();
21251 *v = val;
21252 }
21253 Ok(__struct)
21254 }
21255 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
21256 let mut __tmp = BytesMut::new(bytes);
21257 #[allow(clippy::absurd_extreme_comparisons)]
21258 #[allow(unused_comparisons)]
21259 if __tmp.remaining() < Self::ENCODED_LEN {
21260 panic!(
21261 "buffer is too small (need {} bytes, but got {})",
21262 Self::ENCODED_LEN,
21263 __tmp.remaining(),
21264 )
21265 }
21266 __tmp.put_u64_le(self.time_usec);
21267 __tmp.put_u32_le(self.uptime);
21268 __tmp.put_u32_le(self.ram_usage);
21269 __tmp.put_u32_le(self.ram_total);
21270 for val in &self.storage_type {
21271 __tmp.put_u32_le(*val);
21272 }
21273 for val in &self.storage_usage {
21274 __tmp.put_u32_le(*val);
21275 }
21276 for val in &self.storage_total {
21277 __tmp.put_u32_le(*val);
21278 }
21279 for val in &self.link_type {
21280 __tmp.put_u32_le(*val);
21281 }
21282 for val in &self.link_tx_rate {
21283 __tmp.put_u32_le(*val);
21284 }
21285 for val in &self.link_rx_rate {
21286 __tmp.put_u32_le(*val);
21287 }
21288 for val in &self.link_tx_max {
21289 __tmp.put_u32_le(*val);
21290 }
21291 for val in &self.link_rx_max {
21292 __tmp.put_u32_le(*val);
21293 }
21294 for val in &self.fan_speed {
21295 __tmp.put_i16_le(*val);
21296 }
21297 __tmp.put_u8(self.mavtype);
21298 for val in &self.cpu_cores {
21299 __tmp.put_u8(*val);
21300 }
21301 for val in &self.cpu_combined {
21302 __tmp.put_u8(*val);
21303 }
21304 for val in &self.gpu_cores {
21305 __tmp.put_u8(*val);
21306 }
21307 for val in &self.gpu_combined {
21308 __tmp.put_u8(*val);
21309 }
21310 __tmp.put_i8(self.temperature_board);
21311 for val in &self.temperature_core {
21312 __tmp.put_i8(*val);
21313 }
21314 if matches!(version, MavlinkVersion::V2) {
21315 let len = __tmp.len();
21316 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
21317 } else {
21318 __tmp.len()
21319 }
21320 }
21321}
21322#[doc = "Transmitter (remote ID system) is enabled and ready to start sending location and other required information. This is streamed by transmitter. A flight controller uses it as a condition to arm."]
21323#[doc = ""]
21324#[doc = "ID: 12918"]
21325#[derive(Debug, Clone, PartialEq)]
21326#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
21327#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
21328pub struct OPEN_DRONE_ID_ARM_STATUS_DATA {
21329 #[doc = "Status level indicating if arming is allowed."]
21330 pub status: MavOdidArmStatus,
21331 #[doc = "Text error message, should be empty if status is good to arm. Fill with nulls in unused portion."]
21332 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
21333 pub error: [u8; 50],
21334}
21335impl OPEN_DRONE_ID_ARM_STATUS_DATA {
21336 pub const ENCODED_LEN: usize = 51usize;
21337 pub const DEFAULT: Self = Self {
21338 status: MavOdidArmStatus::DEFAULT,
21339 error: [0_u8; 50usize],
21340 };
21341 #[cfg(feature = "arbitrary")]
21342 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
21343 use arbitrary::{Arbitrary, Unstructured};
21344 let mut buf = [0u8; 1024];
21345 rng.fill_bytes(&mut buf);
21346 let mut unstructured = Unstructured::new(&buf);
21347 Self::arbitrary(&mut unstructured).unwrap_or_default()
21348 }
21349}
21350impl Default for OPEN_DRONE_ID_ARM_STATUS_DATA {
21351 fn default() -> Self {
21352 Self::DEFAULT.clone()
21353 }
21354}
21355impl MessageData for OPEN_DRONE_ID_ARM_STATUS_DATA {
21356 type Message = MavMessage;
21357 const ID: u32 = 12918u32;
21358 const NAME: &'static str = "OPEN_DRONE_ID_ARM_STATUS";
21359 const EXTRA_CRC: u8 = 139u8;
21360 const ENCODED_LEN: usize = 51usize;
21361 fn deser(
21362 _version: MavlinkVersion,
21363 __input: &[u8],
21364 ) -> Result<Self, ::mavlink_core::error::ParserError> {
21365 let avail_len = __input.len();
21366 let mut payload_buf = [0; Self::ENCODED_LEN];
21367 let mut buf = if avail_len < Self::ENCODED_LEN {
21368 payload_buf[0..avail_len].copy_from_slice(__input);
21369 Bytes::new(&payload_buf)
21370 } else {
21371 Bytes::new(__input)
21372 };
21373 let mut __struct = Self::default();
21374 let tmp = buf.get_u8();
21375 __struct.status =
21376 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
21377 enum_type: "MavOdidArmStatus",
21378 value: tmp as u32,
21379 })?;
21380 for v in &mut __struct.error {
21381 let val = buf.get_u8();
21382 *v = val;
21383 }
21384 Ok(__struct)
21385 }
21386 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
21387 let mut __tmp = BytesMut::new(bytes);
21388 #[allow(clippy::absurd_extreme_comparisons)]
21389 #[allow(unused_comparisons)]
21390 if __tmp.remaining() < Self::ENCODED_LEN {
21391 panic!(
21392 "buffer is too small (need {} bytes, but got {})",
21393 Self::ENCODED_LEN,
21394 __tmp.remaining(),
21395 )
21396 }
21397 __tmp.put_u8(self.status as u8);
21398 for val in &self.error {
21399 __tmp.put_u8(*val);
21400 }
21401 if matches!(version, MavlinkVersion::V2) {
21402 let len = __tmp.len();
21403 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
21404 } else {
21405 __tmp.len()
21406 }
21407 }
21408}
21409#[doc = "Data for filling the OpenDroneID Authentication message. The Authentication Message defines a field that can provide a means of authenticity for the identity of the UAS (Unmanned Aircraft System). The Authentication message can have two different formats. For data page 0, the fields PageCount, Length and TimeStamp are present and AuthData is only 17 bytes. For data page 1 through 15, PageCount, Length and TimeStamp are not present and the size of AuthData is 23 bytes."]
21410#[doc = ""]
21411#[doc = "ID: 12902"]
21412#[derive(Debug, Clone, PartialEq)]
21413#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
21414#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
21415pub struct OPEN_DRONE_ID_AUTHENTICATION_DATA {
21416 #[doc = "This field is only present for page 0. 32 bit Unix Timestamp in seconds since 00:00:00 01/01/2019."]
21417 pub timestamp: u32,
21418 #[doc = "System ID (0 for broadcast)."]
21419 pub target_system: u8,
21420 #[doc = "Component ID (0 for broadcast)."]
21421 pub target_component: u8,
21422 #[doc = "Only used for drone ID data received from other UAs. See detailed description at <https://mavlink.io/en/services/opendroneid.html>."]
21423 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
21424 pub id_or_mac: [u8; 20],
21425 #[doc = "Indicates the type of authentication."]
21426 pub authentication_type: MavOdidAuthType,
21427 #[doc = "Allowed range is 0 - 15."]
21428 pub data_page: u8,
21429 #[doc = "This field is only present for page 0. Allowed range is 0 - 15. See the description of struct ODID_Auth_data at <https://github.com/opendroneid/opendroneid-core-c/blob/master/libopendroneid/opendroneid.h>."]
21430 pub last_page_index: u8,
21431 #[doc = "This field is only present for page 0. Total bytes of authentication_data from all data pages. See the description of struct ODID_Auth_data at <https://github.com/opendroneid/opendroneid-core-c/blob/master/libopendroneid/opendroneid.h>."]
21432 pub length: u8,
21433 #[doc = "Opaque authentication data. For page 0, the size is only 17 bytes. For other pages, the size is 23 bytes. Shall be filled with nulls in the unused portion of the field."]
21434 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
21435 pub authentication_data: [u8; 23],
21436}
21437impl OPEN_DRONE_ID_AUTHENTICATION_DATA {
21438 pub const ENCODED_LEN: usize = 53usize;
21439 pub const DEFAULT: Self = Self {
21440 timestamp: 0_u32,
21441 target_system: 0_u8,
21442 target_component: 0_u8,
21443 id_or_mac: [0_u8; 20usize],
21444 authentication_type: MavOdidAuthType::DEFAULT,
21445 data_page: 0_u8,
21446 last_page_index: 0_u8,
21447 length: 0_u8,
21448 authentication_data: [0_u8; 23usize],
21449 };
21450 #[cfg(feature = "arbitrary")]
21451 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
21452 use arbitrary::{Arbitrary, Unstructured};
21453 let mut buf = [0u8; 1024];
21454 rng.fill_bytes(&mut buf);
21455 let mut unstructured = Unstructured::new(&buf);
21456 Self::arbitrary(&mut unstructured).unwrap_or_default()
21457 }
21458}
21459impl Default for OPEN_DRONE_ID_AUTHENTICATION_DATA {
21460 fn default() -> Self {
21461 Self::DEFAULT.clone()
21462 }
21463}
21464impl MessageData for OPEN_DRONE_ID_AUTHENTICATION_DATA {
21465 type Message = MavMessage;
21466 const ID: u32 = 12902u32;
21467 const NAME: &'static str = "OPEN_DRONE_ID_AUTHENTICATION";
21468 const EXTRA_CRC: u8 = 140u8;
21469 const ENCODED_LEN: usize = 53usize;
21470 fn deser(
21471 _version: MavlinkVersion,
21472 __input: &[u8],
21473 ) -> Result<Self, ::mavlink_core::error::ParserError> {
21474 let avail_len = __input.len();
21475 let mut payload_buf = [0; Self::ENCODED_LEN];
21476 let mut buf = if avail_len < Self::ENCODED_LEN {
21477 payload_buf[0..avail_len].copy_from_slice(__input);
21478 Bytes::new(&payload_buf)
21479 } else {
21480 Bytes::new(__input)
21481 };
21482 let mut __struct = Self::default();
21483 __struct.timestamp = buf.get_u32_le();
21484 __struct.target_system = buf.get_u8();
21485 __struct.target_component = buf.get_u8();
21486 for v in &mut __struct.id_or_mac {
21487 let val = buf.get_u8();
21488 *v = val;
21489 }
21490 let tmp = buf.get_u8();
21491 __struct.authentication_type =
21492 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
21493 enum_type: "MavOdidAuthType",
21494 value: tmp as u32,
21495 })?;
21496 __struct.data_page = buf.get_u8();
21497 __struct.last_page_index = buf.get_u8();
21498 __struct.length = buf.get_u8();
21499 for v in &mut __struct.authentication_data {
21500 let val = buf.get_u8();
21501 *v = val;
21502 }
21503 Ok(__struct)
21504 }
21505 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
21506 let mut __tmp = BytesMut::new(bytes);
21507 #[allow(clippy::absurd_extreme_comparisons)]
21508 #[allow(unused_comparisons)]
21509 if __tmp.remaining() < Self::ENCODED_LEN {
21510 panic!(
21511 "buffer is too small (need {} bytes, but got {})",
21512 Self::ENCODED_LEN,
21513 __tmp.remaining(),
21514 )
21515 }
21516 __tmp.put_u32_le(self.timestamp);
21517 __tmp.put_u8(self.target_system);
21518 __tmp.put_u8(self.target_component);
21519 for val in &self.id_or_mac {
21520 __tmp.put_u8(*val);
21521 }
21522 __tmp.put_u8(self.authentication_type as u8);
21523 __tmp.put_u8(self.data_page);
21524 __tmp.put_u8(self.last_page_index);
21525 __tmp.put_u8(self.length);
21526 for val in &self.authentication_data {
21527 __tmp.put_u8(*val);
21528 }
21529 if matches!(version, MavlinkVersion::V2) {
21530 let len = __tmp.len();
21531 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
21532 } else {
21533 __tmp.len()
21534 }
21535 }
21536}
21537#[doc = "Data for filling the OpenDroneID Basic ID message. This and the below messages are primarily meant for feeding data to/from an OpenDroneID implementation. E.g. <https://github.com/opendroneid/opendroneid-core-c>. These messages are compatible with the ASTM F3411 Remote ID standard and the ASD-STAN prEN 4709-002 Direct Remote ID standard. Additional information and usage of these messages is documented at <https://mavlink.io/en/services/opendroneid.html>."]
21538#[doc = ""]
21539#[doc = "ID: 12900"]
21540#[derive(Debug, Clone, PartialEq)]
21541#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
21542#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
21543pub struct OPEN_DRONE_ID_BASIC_ID_DATA {
21544 #[doc = "System ID (0 for broadcast)."]
21545 pub target_system: u8,
21546 #[doc = "Component ID (0 for broadcast)."]
21547 pub target_component: u8,
21548 #[doc = "Only used for drone ID data received from other UAs. See detailed description at <https://mavlink.io/en/services/opendroneid.html>."]
21549 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
21550 pub id_or_mac: [u8; 20],
21551 #[doc = "Indicates the format for the uas_id field of this message."]
21552 pub id_type: MavOdidIdType,
21553 #[doc = "Indicates the type of UA (Unmanned Aircraft)."]
21554 pub ua_type: MavOdidUaType,
21555 #[doc = "UAS (Unmanned Aircraft System) ID following the format specified by id_type. Shall be filled with nulls in the unused portion of the field."]
21556 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
21557 pub uas_id: [u8; 20],
21558}
21559impl OPEN_DRONE_ID_BASIC_ID_DATA {
21560 pub const ENCODED_LEN: usize = 44usize;
21561 pub const DEFAULT: Self = Self {
21562 target_system: 0_u8,
21563 target_component: 0_u8,
21564 id_or_mac: [0_u8; 20usize],
21565 id_type: MavOdidIdType::DEFAULT,
21566 ua_type: MavOdidUaType::DEFAULT,
21567 uas_id: [0_u8; 20usize],
21568 };
21569 #[cfg(feature = "arbitrary")]
21570 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
21571 use arbitrary::{Arbitrary, Unstructured};
21572 let mut buf = [0u8; 1024];
21573 rng.fill_bytes(&mut buf);
21574 let mut unstructured = Unstructured::new(&buf);
21575 Self::arbitrary(&mut unstructured).unwrap_or_default()
21576 }
21577}
21578impl Default for OPEN_DRONE_ID_BASIC_ID_DATA {
21579 fn default() -> Self {
21580 Self::DEFAULT.clone()
21581 }
21582}
21583impl MessageData for OPEN_DRONE_ID_BASIC_ID_DATA {
21584 type Message = MavMessage;
21585 const ID: u32 = 12900u32;
21586 const NAME: &'static str = "OPEN_DRONE_ID_BASIC_ID";
21587 const EXTRA_CRC: u8 = 114u8;
21588 const ENCODED_LEN: usize = 44usize;
21589 fn deser(
21590 _version: MavlinkVersion,
21591 __input: &[u8],
21592 ) -> Result<Self, ::mavlink_core::error::ParserError> {
21593 let avail_len = __input.len();
21594 let mut payload_buf = [0; Self::ENCODED_LEN];
21595 let mut buf = if avail_len < Self::ENCODED_LEN {
21596 payload_buf[0..avail_len].copy_from_slice(__input);
21597 Bytes::new(&payload_buf)
21598 } else {
21599 Bytes::new(__input)
21600 };
21601 let mut __struct = Self::default();
21602 __struct.target_system = buf.get_u8();
21603 __struct.target_component = buf.get_u8();
21604 for v in &mut __struct.id_or_mac {
21605 let val = buf.get_u8();
21606 *v = val;
21607 }
21608 let tmp = buf.get_u8();
21609 __struct.id_type =
21610 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
21611 enum_type: "MavOdidIdType",
21612 value: tmp as u32,
21613 })?;
21614 let tmp = buf.get_u8();
21615 __struct.ua_type =
21616 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
21617 enum_type: "MavOdidUaType",
21618 value: tmp as u32,
21619 })?;
21620 for v in &mut __struct.uas_id {
21621 let val = buf.get_u8();
21622 *v = val;
21623 }
21624 Ok(__struct)
21625 }
21626 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
21627 let mut __tmp = BytesMut::new(bytes);
21628 #[allow(clippy::absurd_extreme_comparisons)]
21629 #[allow(unused_comparisons)]
21630 if __tmp.remaining() < Self::ENCODED_LEN {
21631 panic!(
21632 "buffer is too small (need {} bytes, but got {})",
21633 Self::ENCODED_LEN,
21634 __tmp.remaining(),
21635 )
21636 }
21637 __tmp.put_u8(self.target_system);
21638 __tmp.put_u8(self.target_component);
21639 for val in &self.id_or_mac {
21640 __tmp.put_u8(*val);
21641 }
21642 __tmp.put_u8(self.id_type as u8);
21643 __tmp.put_u8(self.ua_type as u8);
21644 for val in &self.uas_id {
21645 __tmp.put_u8(*val);
21646 }
21647 if matches!(version, MavlinkVersion::V2) {
21648 let len = __tmp.len();
21649 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
21650 } else {
21651 __tmp.len()
21652 }
21653 }
21654}
21655#[doc = "Data for filling the OpenDroneID Location message. The float data types are 32-bit IEEE 754. The Location message provides the location, altitude, direction and speed of the aircraft."]
21656#[doc = ""]
21657#[doc = "ID: 12901"]
21658#[derive(Debug, Clone, PartialEq)]
21659#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
21660#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
21661pub struct OPEN_DRONE_ID_LOCATION_DATA {
21662 #[doc = "Current latitude of the unmanned aircraft. If unknown: 0 (both Lat/Lon)."]
21663 pub latitude: i32,
21664 #[doc = "Current longitude of the unmanned aircraft. If unknown: 0 (both Lat/Lon)."]
21665 pub longitude: i32,
21666 #[doc = "The altitude calculated from the barometric pressue. Reference is against 29.92inHg or 1013.2mb. If unknown: -1000 m."]
21667 pub altitude_barometric: f32,
21668 #[doc = "The geodetic altitude as defined by WGS84. If unknown: -1000 m."]
21669 pub altitude_geodetic: f32,
21670 #[doc = "The current height of the unmanned aircraft above the take-off location or the ground as indicated by height_reference. If unknown: -1000 m."]
21671 pub height: f32,
21672 #[doc = "Seconds after the full hour with reference to UTC time. Typically the GPS outputs a time-of-week value in milliseconds. First convert that to UTC and then convert for this field using ((float) (time_week_ms % (60*60*1000))) / 1000. If unknown: 0xFFFF."]
21673 pub timestamp: f32,
21674 #[doc = "Direction over ground (not heading, but direction of movement) measured clockwise from true North: 0 - 35999 centi-degrees. If unknown: 36100 centi-degrees."]
21675 pub direction: u16,
21676 #[doc = "Ground speed. Positive only. If unknown: 25500 cm/s. If speed is larger than 25425 cm/s, use 25425 cm/s."]
21677 pub speed_horizontal: u16,
21678 #[doc = "The vertical speed. Up is positive. If unknown: 6300 cm/s. If speed is larger than 6200 cm/s, use 6200 cm/s. If lower than -6200 cm/s, use -6200 cm/s."]
21679 pub speed_vertical: i16,
21680 #[doc = "System ID (0 for broadcast)."]
21681 pub target_system: u8,
21682 #[doc = "Component ID (0 for broadcast)."]
21683 pub target_component: u8,
21684 #[doc = "Only used for drone ID data received from other UAs. See detailed description at <https://mavlink.io/en/services/opendroneid.html>."]
21685 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
21686 pub id_or_mac: [u8; 20],
21687 #[doc = "Indicates whether the unmanned aircraft is on the ground or in the air."]
21688 pub status: MavOdidStatus,
21689 #[doc = "Indicates the reference point for the height field."]
21690 pub height_reference: MavOdidHeightRef,
21691 #[doc = "The accuracy of the horizontal position."]
21692 pub horizontal_accuracy: MavOdidHorAcc,
21693 #[doc = "The accuracy of the vertical position."]
21694 pub vertical_accuracy: MavOdidVerAcc,
21695 #[doc = "The accuracy of the barometric altitude."]
21696 pub barometer_accuracy: MavOdidVerAcc,
21697 #[doc = "The accuracy of the horizontal and vertical speed."]
21698 pub speed_accuracy: MavOdidSpeedAcc,
21699 #[doc = "The accuracy of the timestamps."]
21700 pub timestamp_accuracy: MavOdidTimeAcc,
21701}
21702impl OPEN_DRONE_ID_LOCATION_DATA {
21703 pub const ENCODED_LEN: usize = 59usize;
21704 pub const DEFAULT: Self = Self {
21705 latitude: 0_i32,
21706 longitude: 0_i32,
21707 altitude_barometric: 0.0_f32,
21708 altitude_geodetic: 0.0_f32,
21709 height: 0.0_f32,
21710 timestamp: 0.0_f32,
21711 direction: 0_u16,
21712 speed_horizontal: 0_u16,
21713 speed_vertical: 0_i16,
21714 target_system: 0_u8,
21715 target_component: 0_u8,
21716 id_or_mac: [0_u8; 20usize],
21717 status: MavOdidStatus::DEFAULT,
21718 height_reference: MavOdidHeightRef::DEFAULT,
21719 horizontal_accuracy: MavOdidHorAcc::DEFAULT,
21720 vertical_accuracy: MavOdidVerAcc::DEFAULT,
21721 barometer_accuracy: MavOdidVerAcc::DEFAULT,
21722 speed_accuracy: MavOdidSpeedAcc::DEFAULT,
21723 timestamp_accuracy: MavOdidTimeAcc::DEFAULT,
21724 };
21725 #[cfg(feature = "arbitrary")]
21726 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
21727 use arbitrary::{Arbitrary, Unstructured};
21728 let mut buf = [0u8; 1024];
21729 rng.fill_bytes(&mut buf);
21730 let mut unstructured = Unstructured::new(&buf);
21731 Self::arbitrary(&mut unstructured).unwrap_or_default()
21732 }
21733}
21734impl Default for OPEN_DRONE_ID_LOCATION_DATA {
21735 fn default() -> Self {
21736 Self::DEFAULT.clone()
21737 }
21738}
21739impl MessageData for OPEN_DRONE_ID_LOCATION_DATA {
21740 type Message = MavMessage;
21741 const ID: u32 = 12901u32;
21742 const NAME: &'static str = "OPEN_DRONE_ID_LOCATION";
21743 const EXTRA_CRC: u8 = 254u8;
21744 const ENCODED_LEN: usize = 59usize;
21745 fn deser(
21746 _version: MavlinkVersion,
21747 __input: &[u8],
21748 ) -> Result<Self, ::mavlink_core::error::ParserError> {
21749 let avail_len = __input.len();
21750 let mut payload_buf = [0; Self::ENCODED_LEN];
21751 let mut buf = if avail_len < Self::ENCODED_LEN {
21752 payload_buf[0..avail_len].copy_from_slice(__input);
21753 Bytes::new(&payload_buf)
21754 } else {
21755 Bytes::new(__input)
21756 };
21757 let mut __struct = Self::default();
21758 __struct.latitude = buf.get_i32_le();
21759 __struct.longitude = buf.get_i32_le();
21760 __struct.altitude_barometric = buf.get_f32_le();
21761 __struct.altitude_geodetic = buf.get_f32_le();
21762 __struct.height = buf.get_f32_le();
21763 __struct.timestamp = buf.get_f32_le();
21764 __struct.direction = buf.get_u16_le();
21765 __struct.speed_horizontal = buf.get_u16_le();
21766 __struct.speed_vertical = buf.get_i16_le();
21767 __struct.target_system = buf.get_u8();
21768 __struct.target_component = buf.get_u8();
21769 for v in &mut __struct.id_or_mac {
21770 let val = buf.get_u8();
21771 *v = val;
21772 }
21773 let tmp = buf.get_u8();
21774 __struct.status =
21775 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
21776 enum_type: "MavOdidStatus",
21777 value: tmp as u32,
21778 })?;
21779 let tmp = buf.get_u8();
21780 __struct.height_reference =
21781 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
21782 enum_type: "MavOdidHeightRef",
21783 value: tmp as u32,
21784 })?;
21785 let tmp = buf.get_u8();
21786 __struct.horizontal_accuracy =
21787 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
21788 enum_type: "MavOdidHorAcc",
21789 value: tmp as u32,
21790 })?;
21791 let tmp = buf.get_u8();
21792 __struct.vertical_accuracy =
21793 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
21794 enum_type: "MavOdidVerAcc",
21795 value: tmp as u32,
21796 })?;
21797 let tmp = buf.get_u8();
21798 __struct.barometer_accuracy =
21799 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
21800 enum_type: "MavOdidVerAcc",
21801 value: tmp as u32,
21802 })?;
21803 let tmp = buf.get_u8();
21804 __struct.speed_accuracy =
21805 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
21806 enum_type: "MavOdidSpeedAcc",
21807 value: tmp as u32,
21808 })?;
21809 let tmp = buf.get_u8();
21810 __struct.timestamp_accuracy =
21811 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
21812 enum_type: "MavOdidTimeAcc",
21813 value: tmp as u32,
21814 })?;
21815 Ok(__struct)
21816 }
21817 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
21818 let mut __tmp = BytesMut::new(bytes);
21819 #[allow(clippy::absurd_extreme_comparisons)]
21820 #[allow(unused_comparisons)]
21821 if __tmp.remaining() < Self::ENCODED_LEN {
21822 panic!(
21823 "buffer is too small (need {} bytes, but got {})",
21824 Self::ENCODED_LEN,
21825 __tmp.remaining(),
21826 )
21827 }
21828 __tmp.put_i32_le(self.latitude);
21829 __tmp.put_i32_le(self.longitude);
21830 __tmp.put_f32_le(self.altitude_barometric);
21831 __tmp.put_f32_le(self.altitude_geodetic);
21832 __tmp.put_f32_le(self.height);
21833 __tmp.put_f32_le(self.timestamp);
21834 __tmp.put_u16_le(self.direction);
21835 __tmp.put_u16_le(self.speed_horizontal);
21836 __tmp.put_i16_le(self.speed_vertical);
21837 __tmp.put_u8(self.target_system);
21838 __tmp.put_u8(self.target_component);
21839 for val in &self.id_or_mac {
21840 __tmp.put_u8(*val);
21841 }
21842 __tmp.put_u8(self.status as u8);
21843 __tmp.put_u8(self.height_reference as u8);
21844 __tmp.put_u8(self.horizontal_accuracy as u8);
21845 __tmp.put_u8(self.vertical_accuracy as u8);
21846 __tmp.put_u8(self.barometer_accuracy as u8);
21847 __tmp.put_u8(self.speed_accuracy as u8);
21848 __tmp.put_u8(self.timestamp_accuracy as u8);
21849 if matches!(version, MavlinkVersion::V2) {
21850 let len = __tmp.len();
21851 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
21852 } else {
21853 __tmp.len()
21854 }
21855 }
21856}
21857#[doc = "An OpenDroneID message pack is a container for multiple encoded OpenDroneID messages (i.e. not in the format given for the above message descriptions but after encoding into the compressed OpenDroneID byte format). Used e.g. when transmitting on Bluetooth 5.0 Long Range/Extended Advertising or on WiFi Neighbor Aware Networking or on WiFi Beacon."]
21858#[doc = ""]
21859#[doc = "ID: 12915"]
21860#[derive(Debug, Clone, PartialEq)]
21861#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
21862#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
21863pub struct OPEN_DRONE_ID_MESSAGE_PACK_DATA {
21864 #[doc = "System ID (0 for broadcast)."]
21865 pub target_system: u8,
21866 #[doc = "Component ID (0 for broadcast)."]
21867 pub target_component: u8,
21868 #[doc = "Only used for drone ID data received from other UAs. See detailed description at <https://mavlink.io/en/services/opendroneid.html>."]
21869 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
21870 pub id_or_mac: [u8; 20],
21871 #[doc = "This field must currently always be equal to 25 (bytes), since all encoded OpenDroneID messages are specified to have this length."]
21872 pub single_message_size: u8,
21873 #[doc = "Number of encoded messages in the pack (not the number of bytes). Allowed range is 1 - 9."]
21874 pub msg_pack_size: u8,
21875 #[doc = "Concatenation of encoded OpenDroneID messages. Shall be filled with nulls in the unused portion of the field."]
21876 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
21877 pub messages: [u8; 225],
21878}
21879impl OPEN_DRONE_ID_MESSAGE_PACK_DATA {
21880 pub const ENCODED_LEN: usize = 249usize;
21881 pub const DEFAULT: Self = Self {
21882 target_system: 0_u8,
21883 target_component: 0_u8,
21884 id_or_mac: [0_u8; 20usize],
21885 single_message_size: 0_u8,
21886 msg_pack_size: 0_u8,
21887 messages: [0_u8; 225usize],
21888 };
21889 #[cfg(feature = "arbitrary")]
21890 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
21891 use arbitrary::{Arbitrary, Unstructured};
21892 let mut buf = [0u8; 1024];
21893 rng.fill_bytes(&mut buf);
21894 let mut unstructured = Unstructured::new(&buf);
21895 Self::arbitrary(&mut unstructured).unwrap_or_default()
21896 }
21897}
21898impl Default for OPEN_DRONE_ID_MESSAGE_PACK_DATA {
21899 fn default() -> Self {
21900 Self::DEFAULT.clone()
21901 }
21902}
21903impl MessageData for OPEN_DRONE_ID_MESSAGE_PACK_DATA {
21904 type Message = MavMessage;
21905 const ID: u32 = 12915u32;
21906 const NAME: &'static str = "OPEN_DRONE_ID_MESSAGE_PACK";
21907 const EXTRA_CRC: u8 = 94u8;
21908 const ENCODED_LEN: usize = 249usize;
21909 fn deser(
21910 _version: MavlinkVersion,
21911 __input: &[u8],
21912 ) -> Result<Self, ::mavlink_core::error::ParserError> {
21913 let avail_len = __input.len();
21914 let mut payload_buf = [0; Self::ENCODED_LEN];
21915 let mut buf = if avail_len < Self::ENCODED_LEN {
21916 payload_buf[0..avail_len].copy_from_slice(__input);
21917 Bytes::new(&payload_buf)
21918 } else {
21919 Bytes::new(__input)
21920 };
21921 let mut __struct = Self::default();
21922 __struct.target_system = buf.get_u8();
21923 __struct.target_component = buf.get_u8();
21924 for v in &mut __struct.id_or_mac {
21925 let val = buf.get_u8();
21926 *v = val;
21927 }
21928 __struct.single_message_size = buf.get_u8();
21929 __struct.msg_pack_size = buf.get_u8();
21930 for v in &mut __struct.messages {
21931 let val = buf.get_u8();
21932 *v = val;
21933 }
21934 Ok(__struct)
21935 }
21936 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
21937 let mut __tmp = BytesMut::new(bytes);
21938 #[allow(clippy::absurd_extreme_comparisons)]
21939 #[allow(unused_comparisons)]
21940 if __tmp.remaining() < Self::ENCODED_LEN {
21941 panic!(
21942 "buffer is too small (need {} bytes, but got {})",
21943 Self::ENCODED_LEN,
21944 __tmp.remaining(),
21945 )
21946 }
21947 __tmp.put_u8(self.target_system);
21948 __tmp.put_u8(self.target_component);
21949 for val in &self.id_or_mac {
21950 __tmp.put_u8(*val);
21951 }
21952 __tmp.put_u8(self.single_message_size);
21953 __tmp.put_u8(self.msg_pack_size);
21954 for val in &self.messages {
21955 __tmp.put_u8(*val);
21956 }
21957 if matches!(version, MavlinkVersion::V2) {
21958 let len = __tmp.len();
21959 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
21960 } else {
21961 __tmp.len()
21962 }
21963 }
21964}
21965#[doc = "Data for filling the OpenDroneID Operator ID message, which contains the CAA (Civil Aviation Authority) issued operator ID."]
21966#[doc = ""]
21967#[doc = "ID: 12905"]
21968#[derive(Debug, Clone, PartialEq)]
21969#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
21970#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
21971pub struct OPEN_DRONE_ID_OPERATOR_ID_DATA {
21972 #[doc = "System ID (0 for broadcast)."]
21973 pub target_system: u8,
21974 #[doc = "Component ID (0 for broadcast)."]
21975 pub target_component: u8,
21976 #[doc = "Only used for drone ID data received from other UAs. See detailed description at <https://mavlink.io/en/services/opendroneid.html>."]
21977 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
21978 pub id_or_mac: [u8; 20],
21979 #[doc = "Indicates the type of the operator_id field."]
21980 pub operator_id_type: MavOdidOperatorIdType,
21981 #[doc = "Text description or numeric value expressed as ASCII characters. Shall be filled with nulls in the unused portion of the field."]
21982 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
21983 pub operator_id: [u8; 20],
21984}
21985impl OPEN_DRONE_ID_OPERATOR_ID_DATA {
21986 pub const ENCODED_LEN: usize = 43usize;
21987 pub const DEFAULT: Self = Self {
21988 target_system: 0_u8,
21989 target_component: 0_u8,
21990 id_or_mac: [0_u8; 20usize],
21991 operator_id_type: MavOdidOperatorIdType::DEFAULT,
21992 operator_id: [0_u8; 20usize],
21993 };
21994 #[cfg(feature = "arbitrary")]
21995 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
21996 use arbitrary::{Arbitrary, Unstructured};
21997 let mut buf = [0u8; 1024];
21998 rng.fill_bytes(&mut buf);
21999 let mut unstructured = Unstructured::new(&buf);
22000 Self::arbitrary(&mut unstructured).unwrap_or_default()
22001 }
22002}
22003impl Default for OPEN_DRONE_ID_OPERATOR_ID_DATA {
22004 fn default() -> Self {
22005 Self::DEFAULT.clone()
22006 }
22007}
22008impl MessageData for OPEN_DRONE_ID_OPERATOR_ID_DATA {
22009 type Message = MavMessage;
22010 const ID: u32 = 12905u32;
22011 const NAME: &'static str = "OPEN_DRONE_ID_OPERATOR_ID";
22012 const EXTRA_CRC: u8 = 49u8;
22013 const ENCODED_LEN: usize = 43usize;
22014 fn deser(
22015 _version: MavlinkVersion,
22016 __input: &[u8],
22017 ) -> Result<Self, ::mavlink_core::error::ParserError> {
22018 let avail_len = __input.len();
22019 let mut payload_buf = [0; Self::ENCODED_LEN];
22020 let mut buf = if avail_len < Self::ENCODED_LEN {
22021 payload_buf[0..avail_len].copy_from_slice(__input);
22022 Bytes::new(&payload_buf)
22023 } else {
22024 Bytes::new(__input)
22025 };
22026 let mut __struct = Self::default();
22027 __struct.target_system = buf.get_u8();
22028 __struct.target_component = buf.get_u8();
22029 for v in &mut __struct.id_or_mac {
22030 let val = buf.get_u8();
22031 *v = val;
22032 }
22033 let tmp = buf.get_u8();
22034 __struct.operator_id_type =
22035 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
22036 enum_type: "MavOdidOperatorIdType",
22037 value: tmp as u32,
22038 })?;
22039 for v in &mut __struct.operator_id {
22040 let val = buf.get_u8();
22041 *v = val;
22042 }
22043 Ok(__struct)
22044 }
22045 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
22046 let mut __tmp = BytesMut::new(bytes);
22047 #[allow(clippy::absurd_extreme_comparisons)]
22048 #[allow(unused_comparisons)]
22049 if __tmp.remaining() < Self::ENCODED_LEN {
22050 panic!(
22051 "buffer is too small (need {} bytes, but got {})",
22052 Self::ENCODED_LEN,
22053 __tmp.remaining(),
22054 )
22055 }
22056 __tmp.put_u8(self.target_system);
22057 __tmp.put_u8(self.target_component);
22058 for val in &self.id_or_mac {
22059 __tmp.put_u8(*val);
22060 }
22061 __tmp.put_u8(self.operator_id_type as u8);
22062 for val in &self.operator_id {
22063 __tmp.put_u8(*val);
22064 }
22065 if matches!(version, MavlinkVersion::V2) {
22066 let len = __tmp.len();
22067 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
22068 } else {
22069 __tmp.len()
22070 }
22071 }
22072}
22073#[doc = "Data for filling the OpenDroneID Self ID message. The Self ID Message is an opportunity for the operator to (optionally) declare their identity and purpose of the flight. This message can provide additional information that could reduce the threat profile of a UA (Unmanned Aircraft) flying in a particular area or manner. This message can also be used to provide optional additional clarification in an emergency/remote ID system failure situation."]
22074#[doc = ""]
22075#[doc = "ID: 12903"]
22076#[derive(Debug, Clone, PartialEq)]
22077#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
22078#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
22079pub struct OPEN_DRONE_ID_SELF_ID_DATA {
22080 #[doc = "System ID (0 for broadcast)."]
22081 pub target_system: u8,
22082 #[doc = "Component ID (0 for broadcast)."]
22083 pub target_component: u8,
22084 #[doc = "Only used for drone ID data received from other UAs. See detailed description at <https://mavlink.io/en/services/opendroneid.html>."]
22085 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
22086 pub id_or_mac: [u8; 20],
22087 #[doc = "Indicates the type of the description field."]
22088 pub description_type: MavOdidDescType,
22089 #[doc = "Text description or numeric value expressed as ASCII characters. Shall be filled with nulls in the unused portion of the field."]
22090 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
22091 pub description: [u8; 23],
22092}
22093impl OPEN_DRONE_ID_SELF_ID_DATA {
22094 pub const ENCODED_LEN: usize = 46usize;
22095 pub const DEFAULT: Self = Self {
22096 target_system: 0_u8,
22097 target_component: 0_u8,
22098 id_or_mac: [0_u8; 20usize],
22099 description_type: MavOdidDescType::DEFAULT,
22100 description: [0_u8; 23usize],
22101 };
22102 #[cfg(feature = "arbitrary")]
22103 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
22104 use arbitrary::{Arbitrary, Unstructured};
22105 let mut buf = [0u8; 1024];
22106 rng.fill_bytes(&mut buf);
22107 let mut unstructured = Unstructured::new(&buf);
22108 Self::arbitrary(&mut unstructured).unwrap_or_default()
22109 }
22110}
22111impl Default for OPEN_DRONE_ID_SELF_ID_DATA {
22112 fn default() -> Self {
22113 Self::DEFAULT.clone()
22114 }
22115}
22116impl MessageData for OPEN_DRONE_ID_SELF_ID_DATA {
22117 type Message = MavMessage;
22118 const ID: u32 = 12903u32;
22119 const NAME: &'static str = "OPEN_DRONE_ID_SELF_ID";
22120 const EXTRA_CRC: u8 = 249u8;
22121 const ENCODED_LEN: usize = 46usize;
22122 fn deser(
22123 _version: MavlinkVersion,
22124 __input: &[u8],
22125 ) -> Result<Self, ::mavlink_core::error::ParserError> {
22126 let avail_len = __input.len();
22127 let mut payload_buf = [0; Self::ENCODED_LEN];
22128 let mut buf = if avail_len < Self::ENCODED_LEN {
22129 payload_buf[0..avail_len].copy_from_slice(__input);
22130 Bytes::new(&payload_buf)
22131 } else {
22132 Bytes::new(__input)
22133 };
22134 let mut __struct = Self::default();
22135 __struct.target_system = buf.get_u8();
22136 __struct.target_component = buf.get_u8();
22137 for v in &mut __struct.id_or_mac {
22138 let val = buf.get_u8();
22139 *v = val;
22140 }
22141 let tmp = buf.get_u8();
22142 __struct.description_type =
22143 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
22144 enum_type: "MavOdidDescType",
22145 value: tmp as u32,
22146 })?;
22147 for v in &mut __struct.description {
22148 let val = buf.get_u8();
22149 *v = val;
22150 }
22151 Ok(__struct)
22152 }
22153 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
22154 let mut __tmp = BytesMut::new(bytes);
22155 #[allow(clippy::absurd_extreme_comparisons)]
22156 #[allow(unused_comparisons)]
22157 if __tmp.remaining() < Self::ENCODED_LEN {
22158 panic!(
22159 "buffer is too small (need {} bytes, but got {})",
22160 Self::ENCODED_LEN,
22161 __tmp.remaining(),
22162 )
22163 }
22164 __tmp.put_u8(self.target_system);
22165 __tmp.put_u8(self.target_component);
22166 for val in &self.id_or_mac {
22167 __tmp.put_u8(*val);
22168 }
22169 __tmp.put_u8(self.description_type as u8);
22170 for val in &self.description {
22171 __tmp.put_u8(*val);
22172 }
22173 if matches!(version, MavlinkVersion::V2) {
22174 let len = __tmp.len();
22175 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
22176 } else {
22177 __tmp.len()
22178 }
22179 }
22180}
22181#[doc = "Data for filling the OpenDroneID System message. The System Message contains general system information including the operator location/altitude and possible aircraft group and/or category/class information."]
22182#[doc = ""]
22183#[doc = "ID: 12904"]
22184#[derive(Debug, Clone, PartialEq)]
22185#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
22186#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
22187pub struct OPEN_DRONE_ID_SYSTEM_DATA {
22188 #[doc = "Latitude of the operator. If unknown: 0 (both Lat/Lon)."]
22189 pub operator_latitude: i32,
22190 #[doc = "Longitude of the operator. If unknown: 0 (both Lat/Lon)."]
22191 pub operator_longitude: i32,
22192 #[doc = "Area Operations Ceiling relative to WGS84. If unknown: -1000 m. Used only for swarms/multiple UA."]
22193 pub area_ceiling: f32,
22194 #[doc = "Area Operations Floor relative to WGS84. If unknown: -1000 m. Used only for swarms/multiple UA."]
22195 pub area_floor: f32,
22196 #[doc = "Geodetic altitude of the operator relative to WGS84. If unknown: -1000 m."]
22197 pub operator_altitude_geo: f32,
22198 #[doc = "32 bit Unix Timestamp in seconds since 00:00:00 01/01/2019."]
22199 pub timestamp: u32,
22200 #[doc = "Number of aircraft in the area, group or formation (default 1). Used only for swarms/multiple UA."]
22201 pub area_count: u16,
22202 #[doc = "Radius of the cylindrical area of the group or formation (default 0). Used only for swarms/multiple UA."]
22203 pub area_radius: u16,
22204 #[doc = "System ID (0 for broadcast)."]
22205 pub target_system: u8,
22206 #[doc = "Component ID (0 for broadcast)."]
22207 pub target_component: u8,
22208 #[doc = "Only used for drone ID data received from other UAs. See detailed description at <https://mavlink.io/en/services/opendroneid.html>."]
22209 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
22210 pub id_or_mac: [u8; 20],
22211 #[doc = "Specifies the operator location type."]
22212 pub operator_location_type: MavOdidOperatorLocationType,
22213 #[doc = "Specifies the classification type of the UA."]
22214 pub classification_type: MavOdidClassificationType,
22215 #[doc = "When classification_type is MAV_ODID_CLASSIFICATION_TYPE_EU, specifies the category of the UA."]
22216 pub category_eu: MavOdidCategoryEu,
22217 #[doc = "When classification_type is MAV_ODID_CLASSIFICATION_TYPE_EU, specifies the class of the UA."]
22218 pub class_eu: MavOdidClassEu,
22219}
22220impl OPEN_DRONE_ID_SYSTEM_DATA {
22221 pub const ENCODED_LEN: usize = 54usize;
22222 pub const DEFAULT: Self = Self {
22223 operator_latitude: 0_i32,
22224 operator_longitude: 0_i32,
22225 area_ceiling: 0.0_f32,
22226 area_floor: 0.0_f32,
22227 operator_altitude_geo: 0.0_f32,
22228 timestamp: 0_u32,
22229 area_count: 0_u16,
22230 area_radius: 0_u16,
22231 target_system: 0_u8,
22232 target_component: 0_u8,
22233 id_or_mac: [0_u8; 20usize],
22234 operator_location_type: MavOdidOperatorLocationType::DEFAULT,
22235 classification_type: MavOdidClassificationType::DEFAULT,
22236 category_eu: MavOdidCategoryEu::DEFAULT,
22237 class_eu: MavOdidClassEu::DEFAULT,
22238 };
22239 #[cfg(feature = "arbitrary")]
22240 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
22241 use arbitrary::{Arbitrary, Unstructured};
22242 let mut buf = [0u8; 1024];
22243 rng.fill_bytes(&mut buf);
22244 let mut unstructured = Unstructured::new(&buf);
22245 Self::arbitrary(&mut unstructured).unwrap_or_default()
22246 }
22247}
22248impl Default for OPEN_DRONE_ID_SYSTEM_DATA {
22249 fn default() -> Self {
22250 Self::DEFAULT.clone()
22251 }
22252}
22253impl MessageData for OPEN_DRONE_ID_SYSTEM_DATA {
22254 type Message = MavMessage;
22255 const ID: u32 = 12904u32;
22256 const NAME: &'static str = "OPEN_DRONE_ID_SYSTEM";
22257 const EXTRA_CRC: u8 = 77u8;
22258 const ENCODED_LEN: usize = 54usize;
22259 fn deser(
22260 _version: MavlinkVersion,
22261 __input: &[u8],
22262 ) -> Result<Self, ::mavlink_core::error::ParserError> {
22263 let avail_len = __input.len();
22264 let mut payload_buf = [0; Self::ENCODED_LEN];
22265 let mut buf = if avail_len < Self::ENCODED_LEN {
22266 payload_buf[0..avail_len].copy_from_slice(__input);
22267 Bytes::new(&payload_buf)
22268 } else {
22269 Bytes::new(__input)
22270 };
22271 let mut __struct = Self::default();
22272 __struct.operator_latitude = buf.get_i32_le();
22273 __struct.operator_longitude = buf.get_i32_le();
22274 __struct.area_ceiling = buf.get_f32_le();
22275 __struct.area_floor = buf.get_f32_le();
22276 __struct.operator_altitude_geo = buf.get_f32_le();
22277 __struct.timestamp = buf.get_u32_le();
22278 __struct.area_count = buf.get_u16_le();
22279 __struct.area_radius = buf.get_u16_le();
22280 __struct.target_system = buf.get_u8();
22281 __struct.target_component = buf.get_u8();
22282 for v in &mut __struct.id_or_mac {
22283 let val = buf.get_u8();
22284 *v = val;
22285 }
22286 let tmp = buf.get_u8();
22287 __struct.operator_location_type =
22288 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
22289 enum_type: "MavOdidOperatorLocationType",
22290 value: tmp as u32,
22291 })?;
22292 let tmp = buf.get_u8();
22293 __struct.classification_type =
22294 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
22295 enum_type: "MavOdidClassificationType",
22296 value: tmp as u32,
22297 })?;
22298 let tmp = buf.get_u8();
22299 __struct.category_eu =
22300 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
22301 enum_type: "MavOdidCategoryEu",
22302 value: tmp as u32,
22303 })?;
22304 let tmp = buf.get_u8();
22305 __struct.class_eu =
22306 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
22307 enum_type: "MavOdidClassEu",
22308 value: tmp as u32,
22309 })?;
22310 Ok(__struct)
22311 }
22312 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
22313 let mut __tmp = BytesMut::new(bytes);
22314 #[allow(clippy::absurd_extreme_comparisons)]
22315 #[allow(unused_comparisons)]
22316 if __tmp.remaining() < Self::ENCODED_LEN {
22317 panic!(
22318 "buffer is too small (need {} bytes, but got {})",
22319 Self::ENCODED_LEN,
22320 __tmp.remaining(),
22321 )
22322 }
22323 __tmp.put_i32_le(self.operator_latitude);
22324 __tmp.put_i32_le(self.operator_longitude);
22325 __tmp.put_f32_le(self.area_ceiling);
22326 __tmp.put_f32_le(self.area_floor);
22327 __tmp.put_f32_le(self.operator_altitude_geo);
22328 __tmp.put_u32_le(self.timestamp);
22329 __tmp.put_u16_le(self.area_count);
22330 __tmp.put_u16_le(self.area_radius);
22331 __tmp.put_u8(self.target_system);
22332 __tmp.put_u8(self.target_component);
22333 for val in &self.id_or_mac {
22334 __tmp.put_u8(*val);
22335 }
22336 __tmp.put_u8(self.operator_location_type as u8);
22337 __tmp.put_u8(self.classification_type as u8);
22338 __tmp.put_u8(self.category_eu as u8);
22339 __tmp.put_u8(self.class_eu as u8);
22340 if matches!(version, MavlinkVersion::V2) {
22341 let len = __tmp.len();
22342 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
22343 } else {
22344 __tmp.len()
22345 }
22346 }
22347}
22348#[doc = "Update the data in the OPEN_DRONE_ID_SYSTEM message with new location information. This can be sent to update the location information for the operator when no other information in the SYSTEM message has changed. This message allows for efficient operation on radio links which have limited uplink bandwidth while meeting requirements for update frequency of the operator location."]
22349#[doc = ""]
22350#[doc = "ID: 12919"]
22351#[derive(Debug, Clone, PartialEq)]
22352#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
22353#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
22354pub struct OPEN_DRONE_ID_SYSTEM_UPDATE_DATA {
22355 #[doc = "Latitude of the operator. If unknown: 0 (both Lat/Lon)."]
22356 pub operator_latitude: i32,
22357 #[doc = "Longitude of the operator. If unknown: 0 (both Lat/Lon)."]
22358 pub operator_longitude: i32,
22359 #[doc = "Geodetic altitude of the operator relative to WGS84. If unknown: -1000 m."]
22360 pub operator_altitude_geo: f32,
22361 #[doc = "32 bit Unix Timestamp in seconds since 00:00:00 01/01/2019."]
22362 pub timestamp: u32,
22363 #[doc = "System ID (0 for broadcast)."]
22364 pub target_system: u8,
22365 #[doc = "Component ID (0 for broadcast)."]
22366 pub target_component: u8,
22367}
22368impl OPEN_DRONE_ID_SYSTEM_UPDATE_DATA {
22369 pub const ENCODED_LEN: usize = 18usize;
22370 pub const DEFAULT: Self = Self {
22371 operator_latitude: 0_i32,
22372 operator_longitude: 0_i32,
22373 operator_altitude_geo: 0.0_f32,
22374 timestamp: 0_u32,
22375 target_system: 0_u8,
22376 target_component: 0_u8,
22377 };
22378 #[cfg(feature = "arbitrary")]
22379 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
22380 use arbitrary::{Arbitrary, Unstructured};
22381 let mut buf = [0u8; 1024];
22382 rng.fill_bytes(&mut buf);
22383 let mut unstructured = Unstructured::new(&buf);
22384 Self::arbitrary(&mut unstructured).unwrap_or_default()
22385 }
22386}
22387impl Default for OPEN_DRONE_ID_SYSTEM_UPDATE_DATA {
22388 fn default() -> Self {
22389 Self::DEFAULT.clone()
22390 }
22391}
22392impl MessageData for OPEN_DRONE_ID_SYSTEM_UPDATE_DATA {
22393 type Message = MavMessage;
22394 const ID: u32 = 12919u32;
22395 const NAME: &'static str = "OPEN_DRONE_ID_SYSTEM_UPDATE";
22396 const EXTRA_CRC: u8 = 7u8;
22397 const ENCODED_LEN: usize = 18usize;
22398 fn deser(
22399 _version: MavlinkVersion,
22400 __input: &[u8],
22401 ) -> Result<Self, ::mavlink_core::error::ParserError> {
22402 let avail_len = __input.len();
22403 let mut payload_buf = [0; Self::ENCODED_LEN];
22404 let mut buf = if avail_len < Self::ENCODED_LEN {
22405 payload_buf[0..avail_len].copy_from_slice(__input);
22406 Bytes::new(&payload_buf)
22407 } else {
22408 Bytes::new(__input)
22409 };
22410 let mut __struct = Self::default();
22411 __struct.operator_latitude = buf.get_i32_le();
22412 __struct.operator_longitude = buf.get_i32_le();
22413 __struct.operator_altitude_geo = buf.get_f32_le();
22414 __struct.timestamp = buf.get_u32_le();
22415 __struct.target_system = buf.get_u8();
22416 __struct.target_component = buf.get_u8();
22417 Ok(__struct)
22418 }
22419 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
22420 let mut __tmp = BytesMut::new(bytes);
22421 #[allow(clippy::absurd_extreme_comparisons)]
22422 #[allow(unused_comparisons)]
22423 if __tmp.remaining() < Self::ENCODED_LEN {
22424 panic!(
22425 "buffer is too small (need {} bytes, but got {})",
22426 Self::ENCODED_LEN,
22427 __tmp.remaining(),
22428 )
22429 }
22430 __tmp.put_i32_le(self.operator_latitude);
22431 __tmp.put_i32_le(self.operator_longitude);
22432 __tmp.put_f32_le(self.operator_altitude_geo);
22433 __tmp.put_u32_le(self.timestamp);
22434 __tmp.put_u8(self.target_system);
22435 __tmp.put_u8(self.target_component);
22436 if matches!(version, MavlinkVersion::V2) {
22437 let len = __tmp.len();
22438 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
22439 } else {
22440 __tmp.len()
22441 }
22442 }
22443}
22444#[doc = "Optical flow from a flow sensor (e.g. optical mouse sensor)."]
22445#[doc = ""]
22446#[doc = "ID: 100"]
22447#[derive(Debug, Clone, PartialEq)]
22448#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
22449#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
22450pub struct OPTICAL_FLOW_DATA {
22451 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
22452 pub time_usec: u64,
22453 #[doc = "Flow in x-sensor direction, angular-speed compensated"]
22454 pub flow_comp_m_x: f32,
22455 #[doc = "Flow in y-sensor direction, angular-speed compensated"]
22456 pub flow_comp_m_y: f32,
22457 #[doc = "Ground distance. Positive value: distance known. Negative value: Unknown distance"]
22458 pub ground_distance: f32,
22459 #[doc = "Flow in x-sensor direction"]
22460 pub flow_x: i16,
22461 #[doc = "Flow in y-sensor direction"]
22462 pub flow_y: i16,
22463 #[doc = "Sensor ID"]
22464 pub sensor_id: u8,
22465 #[doc = "Optical flow quality / confidence. 0: bad, 255: maximum quality"]
22466 pub quality: u8,
22467 #[doc = "Flow rate about X axis"]
22468 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
22469 pub flow_rate_x: f32,
22470 #[doc = "Flow rate about Y axis"]
22471 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
22472 pub flow_rate_y: f32,
22473}
22474impl OPTICAL_FLOW_DATA {
22475 pub const ENCODED_LEN: usize = 34usize;
22476 pub const DEFAULT: Self = Self {
22477 time_usec: 0_u64,
22478 flow_comp_m_x: 0.0_f32,
22479 flow_comp_m_y: 0.0_f32,
22480 ground_distance: 0.0_f32,
22481 flow_x: 0_i16,
22482 flow_y: 0_i16,
22483 sensor_id: 0_u8,
22484 quality: 0_u8,
22485 flow_rate_x: 0.0_f32,
22486 flow_rate_y: 0.0_f32,
22487 };
22488 #[cfg(feature = "arbitrary")]
22489 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
22490 use arbitrary::{Arbitrary, Unstructured};
22491 let mut buf = [0u8; 1024];
22492 rng.fill_bytes(&mut buf);
22493 let mut unstructured = Unstructured::new(&buf);
22494 Self::arbitrary(&mut unstructured).unwrap_or_default()
22495 }
22496}
22497impl Default for OPTICAL_FLOW_DATA {
22498 fn default() -> Self {
22499 Self::DEFAULT.clone()
22500 }
22501}
22502impl MessageData for OPTICAL_FLOW_DATA {
22503 type Message = MavMessage;
22504 const ID: u32 = 100u32;
22505 const NAME: &'static str = "OPTICAL_FLOW";
22506 const EXTRA_CRC: u8 = 175u8;
22507 const ENCODED_LEN: usize = 34usize;
22508 fn deser(
22509 _version: MavlinkVersion,
22510 __input: &[u8],
22511 ) -> Result<Self, ::mavlink_core::error::ParserError> {
22512 let avail_len = __input.len();
22513 let mut payload_buf = [0; Self::ENCODED_LEN];
22514 let mut buf = if avail_len < Self::ENCODED_LEN {
22515 payload_buf[0..avail_len].copy_from_slice(__input);
22516 Bytes::new(&payload_buf)
22517 } else {
22518 Bytes::new(__input)
22519 };
22520 let mut __struct = Self::default();
22521 __struct.time_usec = buf.get_u64_le();
22522 __struct.flow_comp_m_x = buf.get_f32_le();
22523 __struct.flow_comp_m_y = buf.get_f32_le();
22524 __struct.ground_distance = buf.get_f32_le();
22525 __struct.flow_x = buf.get_i16_le();
22526 __struct.flow_y = buf.get_i16_le();
22527 __struct.sensor_id = buf.get_u8();
22528 __struct.quality = buf.get_u8();
22529 __struct.flow_rate_x = buf.get_f32_le();
22530 __struct.flow_rate_y = buf.get_f32_le();
22531 Ok(__struct)
22532 }
22533 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
22534 let mut __tmp = BytesMut::new(bytes);
22535 #[allow(clippy::absurd_extreme_comparisons)]
22536 #[allow(unused_comparisons)]
22537 if __tmp.remaining() < Self::ENCODED_LEN {
22538 panic!(
22539 "buffer is too small (need {} bytes, but got {})",
22540 Self::ENCODED_LEN,
22541 __tmp.remaining(),
22542 )
22543 }
22544 __tmp.put_u64_le(self.time_usec);
22545 __tmp.put_f32_le(self.flow_comp_m_x);
22546 __tmp.put_f32_le(self.flow_comp_m_y);
22547 __tmp.put_f32_le(self.ground_distance);
22548 __tmp.put_i16_le(self.flow_x);
22549 __tmp.put_i16_le(self.flow_y);
22550 __tmp.put_u8(self.sensor_id);
22551 __tmp.put_u8(self.quality);
22552 if matches!(version, MavlinkVersion::V2) {
22553 __tmp.put_f32_le(self.flow_rate_x);
22554 __tmp.put_f32_le(self.flow_rate_y);
22555 let len = __tmp.len();
22556 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
22557 } else {
22558 __tmp.len()
22559 }
22560 }
22561}
22562#[doc = "Optical flow from an angular rate flow sensor (e.g. PX4FLOW or mouse sensor)."]
22563#[doc = ""]
22564#[doc = "ID: 106"]
22565#[derive(Debug, Clone, PartialEq)]
22566#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
22567#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
22568pub struct OPTICAL_FLOW_RAD_DATA {
22569 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
22570 pub time_usec: u64,
22571 #[doc = "Integration time. Divide integrated_x and integrated_y by the integration time to obtain average flow. The integration time also indicates the."]
22572 pub integration_time_us: u32,
22573 #[doc = "Flow around X axis (Sensor RH rotation about the X axis induces a positive flow. Sensor linear motion along the positive Y axis induces a negative flow.)"]
22574 pub integrated_x: f32,
22575 #[doc = "Flow around Y axis (Sensor RH rotation about the Y axis induces a positive flow. Sensor linear motion along the positive X axis induces a positive flow.)"]
22576 pub integrated_y: f32,
22577 #[doc = "RH rotation around X axis"]
22578 pub integrated_xgyro: f32,
22579 #[doc = "RH rotation around Y axis"]
22580 pub integrated_ygyro: f32,
22581 #[doc = "RH rotation around Z axis"]
22582 pub integrated_zgyro: f32,
22583 #[doc = "Time since the distance was sampled."]
22584 pub time_delta_distance_us: u32,
22585 #[doc = "Distance to the center of the flow field. Positive value (including zero): distance known. Negative value: Unknown distance."]
22586 pub distance: f32,
22587 #[doc = "Temperature"]
22588 pub temperature: i16,
22589 #[doc = "Sensor ID"]
22590 pub sensor_id: u8,
22591 #[doc = "Optical flow quality / confidence. 0: no valid flow, 255: maximum quality"]
22592 pub quality: u8,
22593}
22594impl OPTICAL_FLOW_RAD_DATA {
22595 pub const ENCODED_LEN: usize = 44usize;
22596 pub const DEFAULT: Self = Self {
22597 time_usec: 0_u64,
22598 integration_time_us: 0_u32,
22599 integrated_x: 0.0_f32,
22600 integrated_y: 0.0_f32,
22601 integrated_xgyro: 0.0_f32,
22602 integrated_ygyro: 0.0_f32,
22603 integrated_zgyro: 0.0_f32,
22604 time_delta_distance_us: 0_u32,
22605 distance: 0.0_f32,
22606 temperature: 0_i16,
22607 sensor_id: 0_u8,
22608 quality: 0_u8,
22609 };
22610 #[cfg(feature = "arbitrary")]
22611 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
22612 use arbitrary::{Arbitrary, Unstructured};
22613 let mut buf = [0u8; 1024];
22614 rng.fill_bytes(&mut buf);
22615 let mut unstructured = Unstructured::new(&buf);
22616 Self::arbitrary(&mut unstructured).unwrap_or_default()
22617 }
22618}
22619impl Default for OPTICAL_FLOW_RAD_DATA {
22620 fn default() -> Self {
22621 Self::DEFAULT.clone()
22622 }
22623}
22624impl MessageData for OPTICAL_FLOW_RAD_DATA {
22625 type Message = MavMessage;
22626 const ID: u32 = 106u32;
22627 const NAME: &'static str = "OPTICAL_FLOW_RAD";
22628 const EXTRA_CRC: u8 = 138u8;
22629 const ENCODED_LEN: usize = 44usize;
22630 fn deser(
22631 _version: MavlinkVersion,
22632 __input: &[u8],
22633 ) -> Result<Self, ::mavlink_core::error::ParserError> {
22634 let avail_len = __input.len();
22635 let mut payload_buf = [0; Self::ENCODED_LEN];
22636 let mut buf = if avail_len < Self::ENCODED_LEN {
22637 payload_buf[0..avail_len].copy_from_slice(__input);
22638 Bytes::new(&payload_buf)
22639 } else {
22640 Bytes::new(__input)
22641 };
22642 let mut __struct = Self::default();
22643 __struct.time_usec = buf.get_u64_le();
22644 __struct.integration_time_us = buf.get_u32_le();
22645 __struct.integrated_x = buf.get_f32_le();
22646 __struct.integrated_y = buf.get_f32_le();
22647 __struct.integrated_xgyro = buf.get_f32_le();
22648 __struct.integrated_ygyro = buf.get_f32_le();
22649 __struct.integrated_zgyro = buf.get_f32_le();
22650 __struct.time_delta_distance_us = buf.get_u32_le();
22651 __struct.distance = buf.get_f32_le();
22652 __struct.temperature = buf.get_i16_le();
22653 __struct.sensor_id = buf.get_u8();
22654 __struct.quality = buf.get_u8();
22655 Ok(__struct)
22656 }
22657 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
22658 let mut __tmp = BytesMut::new(bytes);
22659 #[allow(clippy::absurd_extreme_comparisons)]
22660 #[allow(unused_comparisons)]
22661 if __tmp.remaining() < Self::ENCODED_LEN {
22662 panic!(
22663 "buffer is too small (need {} bytes, but got {})",
22664 Self::ENCODED_LEN,
22665 __tmp.remaining(),
22666 )
22667 }
22668 __tmp.put_u64_le(self.time_usec);
22669 __tmp.put_u32_le(self.integration_time_us);
22670 __tmp.put_f32_le(self.integrated_x);
22671 __tmp.put_f32_le(self.integrated_y);
22672 __tmp.put_f32_le(self.integrated_xgyro);
22673 __tmp.put_f32_le(self.integrated_ygyro);
22674 __tmp.put_f32_le(self.integrated_zgyro);
22675 __tmp.put_u32_le(self.time_delta_distance_us);
22676 __tmp.put_f32_le(self.distance);
22677 __tmp.put_i16_le(self.temperature);
22678 __tmp.put_u8(self.sensor_id);
22679 __tmp.put_u8(self.quality);
22680 if matches!(version, MavlinkVersion::V2) {
22681 let len = __tmp.len();
22682 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
22683 } else {
22684 __tmp.len()
22685 }
22686 }
22687}
22688#[doc = "Vehicle status report that is sent out while orbit execution is in progress (see MAV_CMD_DO_ORBIT)."]
22689#[doc = ""]
22690#[doc = "ID: 360"]
22691#[derive(Debug, Clone, PartialEq)]
22692#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
22693#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
22694pub struct ORBIT_EXECUTION_STATUS_DATA {
22695 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
22696 pub time_usec: u64,
22697 #[doc = "Radius of the orbit circle. Positive values orbit clockwise, negative values orbit counter-clockwise."]
22698 pub radius: f32,
22699 #[doc = "X coordinate of center point. Coordinate system depends on frame field: local = x position in meters * 1e4, global = latitude in degrees * 1e7."]
22700 pub x: i32,
22701 #[doc = "Y coordinate of center point. Coordinate system depends on frame field: local = x position in meters * 1e4, global = latitude in degrees * 1e7."]
22702 pub y: i32,
22703 #[doc = "Altitude of center point. Coordinate system depends on frame field."]
22704 pub z: f32,
22705 #[doc = "The coordinate system of the fields: x, y, z."]
22706 pub frame: MavFrame,
22707}
22708impl ORBIT_EXECUTION_STATUS_DATA {
22709 pub const ENCODED_LEN: usize = 25usize;
22710 pub const DEFAULT: Self = Self {
22711 time_usec: 0_u64,
22712 radius: 0.0_f32,
22713 x: 0_i32,
22714 y: 0_i32,
22715 z: 0.0_f32,
22716 frame: MavFrame::DEFAULT,
22717 };
22718 #[cfg(feature = "arbitrary")]
22719 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
22720 use arbitrary::{Arbitrary, Unstructured};
22721 let mut buf = [0u8; 1024];
22722 rng.fill_bytes(&mut buf);
22723 let mut unstructured = Unstructured::new(&buf);
22724 Self::arbitrary(&mut unstructured).unwrap_or_default()
22725 }
22726}
22727impl Default for ORBIT_EXECUTION_STATUS_DATA {
22728 fn default() -> Self {
22729 Self::DEFAULT.clone()
22730 }
22731}
22732impl MessageData for ORBIT_EXECUTION_STATUS_DATA {
22733 type Message = MavMessage;
22734 const ID: u32 = 360u32;
22735 const NAME: &'static str = "ORBIT_EXECUTION_STATUS";
22736 const EXTRA_CRC: u8 = 11u8;
22737 const ENCODED_LEN: usize = 25usize;
22738 fn deser(
22739 _version: MavlinkVersion,
22740 __input: &[u8],
22741 ) -> Result<Self, ::mavlink_core::error::ParserError> {
22742 let avail_len = __input.len();
22743 let mut payload_buf = [0; Self::ENCODED_LEN];
22744 let mut buf = if avail_len < Self::ENCODED_LEN {
22745 payload_buf[0..avail_len].copy_from_slice(__input);
22746 Bytes::new(&payload_buf)
22747 } else {
22748 Bytes::new(__input)
22749 };
22750 let mut __struct = Self::default();
22751 __struct.time_usec = buf.get_u64_le();
22752 __struct.radius = buf.get_f32_le();
22753 __struct.x = buf.get_i32_le();
22754 __struct.y = buf.get_i32_le();
22755 __struct.z = buf.get_f32_le();
22756 let tmp = buf.get_u8();
22757 __struct.frame =
22758 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
22759 enum_type: "MavFrame",
22760 value: tmp as u32,
22761 })?;
22762 Ok(__struct)
22763 }
22764 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
22765 let mut __tmp = BytesMut::new(bytes);
22766 #[allow(clippy::absurd_extreme_comparisons)]
22767 #[allow(unused_comparisons)]
22768 if __tmp.remaining() < Self::ENCODED_LEN {
22769 panic!(
22770 "buffer is too small (need {} bytes, but got {})",
22771 Self::ENCODED_LEN,
22772 __tmp.remaining(),
22773 )
22774 }
22775 __tmp.put_u64_le(self.time_usec);
22776 __tmp.put_f32_le(self.radius);
22777 __tmp.put_i32_le(self.x);
22778 __tmp.put_i32_le(self.y);
22779 __tmp.put_f32_le(self.z);
22780 __tmp.put_u8(self.frame as u8);
22781 if matches!(version, MavlinkVersion::V2) {
22782 let len = __tmp.len();
22783 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
22784 } else {
22785 __tmp.len()
22786 }
22787 }
22788}
22789#[doc = "Response from a PARAM_EXT_SET message."]
22790#[doc = ""]
22791#[doc = "ID: 324"]
22792#[derive(Debug, Clone, PartialEq)]
22793#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
22794#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
22795pub struct PARAM_EXT_ACK_DATA {
22796 #[doc = "Parameter id, terminated by NULL if the length is less than 16 human-readable chars and WITHOUT null termination (NULL) byte if the length is exactly 16 chars - applications have to provide 16+1 bytes storage if the ID is stored as string"]
22797 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
22798 pub param_id: [u8; 16],
22799 #[doc = "Parameter value (new value if PARAM_ACK_ACCEPTED, current value otherwise)"]
22800 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
22801 pub param_value: [u8; 128],
22802 #[doc = "Parameter type."]
22803 pub param_type: MavParamExtType,
22804 #[doc = "Result code."]
22805 pub param_result: ParamAck,
22806}
22807impl PARAM_EXT_ACK_DATA {
22808 pub const ENCODED_LEN: usize = 146usize;
22809 pub const DEFAULT: Self = Self {
22810 param_id: [0_u8; 16usize],
22811 param_value: [0_u8; 128usize],
22812 param_type: MavParamExtType::DEFAULT,
22813 param_result: ParamAck::DEFAULT,
22814 };
22815 #[cfg(feature = "arbitrary")]
22816 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
22817 use arbitrary::{Arbitrary, Unstructured};
22818 let mut buf = [0u8; 1024];
22819 rng.fill_bytes(&mut buf);
22820 let mut unstructured = Unstructured::new(&buf);
22821 Self::arbitrary(&mut unstructured).unwrap_or_default()
22822 }
22823}
22824impl Default for PARAM_EXT_ACK_DATA {
22825 fn default() -> Self {
22826 Self::DEFAULT.clone()
22827 }
22828}
22829impl MessageData for PARAM_EXT_ACK_DATA {
22830 type Message = MavMessage;
22831 const ID: u32 = 324u32;
22832 const NAME: &'static str = "PARAM_EXT_ACK";
22833 const EXTRA_CRC: u8 = 132u8;
22834 const ENCODED_LEN: usize = 146usize;
22835 fn deser(
22836 _version: MavlinkVersion,
22837 __input: &[u8],
22838 ) -> Result<Self, ::mavlink_core::error::ParserError> {
22839 let avail_len = __input.len();
22840 let mut payload_buf = [0; Self::ENCODED_LEN];
22841 let mut buf = if avail_len < Self::ENCODED_LEN {
22842 payload_buf[0..avail_len].copy_from_slice(__input);
22843 Bytes::new(&payload_buf)
22844 } else {
22845 Bytes::new(__input)
22846 };
22847 let mut __struct = Self::default();
22848 for v in &mut __struct.param_id {
22849 let val = buf.get_u8();
22850 *v = val;
22851 }
22852 for v in &mut __struct.param_value {
22853 let val = buf.get_u8();
22854 *v = val;
22855 }
22856 let tmp = buf.get_u8();
22857 __struct.param_type =
22858 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
22859 enum_type: "MavParamExtType",
22860 value: tmp as u32,
22861 })?;
22862 let tmp = buf.get_u8();
22863 __struct.param_result =
22864 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
22865 enum_type: "ParamAck",
22866 value: tmp as u32,
22867 })?;
22868 Ok(__struct)
22869 }
22870 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
22871 let mut __tmp = BytesMut::new(bytes);
22872 #[allow(clippy::absurd_extreme_comparisons)]
22873 #[allow(unused_comparisons)]
22874 if __tmp.remaining() < Self::ENCODED_LEN {
22875 panic!(
22876 "buffer is too small (need {} bytes, but got {})",
22877 Self::ENCODED_LEN,
22878 __tmp.remaining(),
22879 )
22880 }
22881 for val in &self.param_id {
22882 __tmp.put_u8(*val);
22883 }
22884 for val in &self.param_value {
22885 __tmp.put_u8(*val);
22886 }
22887 __tmp.put_u8(self.param_type as u8);
22888 __tmp.put_u8(self.param_result as u8);
22889 if matches!(version, MavlinkVersion::V2) {
22890 let len = __tmp.len();
22891 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
22892 } else {
22893 __tmp.len()
22894 }
22895 }
22896}
22897#[doc = "Request all parameters of this component. All parameters should be emitted in response as PARAM_EXT_VALUE."]
22898#[doc = ""]
22899#[doc = "ID: 321"]
22900#[derive(Debug, Clone, PartialEq)]
22901#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
22902#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
22903pub struct PARAM_EXT_REQUEST_LIST_DATA {
22904 #[doc = "System ID"]
22905 pub target_system: u8,
22906 #[doc = "Component ID"]
22907 pub target_component: u8,
22908}
22909impl PARAM_EXT_REQUEST_LIST_DATA {
22910 pub const ENCODED_LEN: usize = 2usize;
22911 pub const DEFAULT: Self = Self {
22912 target_system: 0_u8,
22913 target_component: 0_u8,
22914 };
22915 #[cfg(feature = "arbitrary")]
22916 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
22917 use arbitrary::{Arbitrary, Unstructured};
22918 let mut buf = [0u8; 1024];
22919 rng.fill_bytes(&mut buf);
22920 let mut unstructured = Unstructured::new(&buf);
22921 Self::arbitrary(&mut unstructured).unwrap_or_default()
22922 }
22923}
22924impl Default for PARAM_EXT_REQUEST_LIST_DATA {
22925 fn default() -> Self {
22926 Self::DEFAULT.clone()
22927 }
22928}
22929impl MessageData for PARAM_EXT_REQUEST_LIST_DATA {
22930 type Message = MavMessage;
22931 const ID: u32 = 321u32;
22932 const NAME: &'static str = "PARAM_EXT_REQUEST_LIST";
22933 const EXTRA_CRC: u8 = 88u8;
22934 const ENCODED_LEN: usize = 2usize;
22935 fn deser(
22936 _version: MavlinkVersion,
22937 __input: &[u8],
22938 ) -> Result<Self, ::mavlink_core::error::ParserError> {
22939 let avail_len = __input.len();
22940 let mut payload_buf = [0; Self::ENCODED_LEN];
22941 let mut buf = if avail_len < Self::ENCODED_LEN {
22942 payload_buf[0..avail_len].copy_from_slice(__input);
22943 Bytes::new(&payload_buf)
22944 } else {
22945 Bytes::new(__input)
22946 };
22947 let mut __struct = Self::default();
22948 __struct.target_system = buf.get_u8();
22949 __struct.target_component = buf.get_u8();
22950 Ok(__struct)
22951 }
22952 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
22953 let mut __tmp = BytesMut::new(bytes);
22954 #[allow(clippy::absurd_extreme_comparisons)]
22955 #[allow(unused_comparisons)]
22956 if __tmp.remaining() < Self::ENCODED_LEN {
22957 panic!(
22958 "buffer is too small (need {} bytes, but got {})",
22959 Self::ENCODED_LEN,
22960 __tmp.remaining(),
22961 )
22962 }
22963 __tmp.put_u8(self.target_system);
22964 __tmp.put_u8(self.target_component);
22965 if matches!(version, MavlinkVersion::V2) {
22966 let len = __tmp.len();
22967 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
22968 } else {
22969 __tmp.len()
22970 }
22971 }
22972}
22973#[doc = "Request to read the value of a parameter with either the param_id string id or param_index. PARAM_EXT_VALUE should be emitted in response."]
22974#[doc = ""]
22975#[doc = "ID: 320"]
22976#[derive(Debug, Clone, PartialEq)]
22977#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
22978#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
22979pub struct PARAM_EXT_REQUEST_READ_DATA {
22980 #[doc = "Parameter index. Set to -1 to use the Parameter ID field as identifier (else param_id will be ignored)"]
22981 pub param_index: i16,
22982 #[doc = "System ID"]
22983 pub target_system: u8,
22984 #[doc = "Component ID"]
22985 pub target_component: u8,
22986 #[doc = "Parameter id, terminated by NULL if the length is less than 16 human-readable chars and WITHOUT null termination (NULL) byte if the length is exactly 16 chars - applications have to provide 16+1 bytes storage if the ID is stored as string"]
22987 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
22988 pub param_id: [u8; 16],
22989}
22990impl PARAM_EXT_REQUEST_READ_DATA {
22991 pub const ENCODED_LEN: usize = 20usize;
22992 pub const DEFAULT: Self = Self {
22993 param_index: 0_i16,
22994 target_system: 0_u8,
22995 target_component: 0_u8,
22996 param_id: [0_u8; 16usize],
22997 };
22998 #[cfg(feature = "arbitrary")]
22999 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
23000 use arbitrary::{Arbitrary, Unstructured};
23001 let mut buf = [0u8; 1024];
23002 rng.fill_bytes(&mut buf);
23003 let mut unstructured = Unstructured::new(&buf);
23004 Self::arbitrary(&mut unstructured).unwrap_or_default()
23005 }
23006}
23007impl Default for PARAM_EXT_REQUEST_READ_DATA {
23008 fn default() -> Self {
23009 Self::DEFAULT.clone()
23010 }
23011}
23012impl MessageData for PARAM_EXT_REQUEST_READ_DATA {
23013 type Message = MavMessage;
23014 const ID: u32 = 320u32;
23015 const NAME: &'static str = "PARAM_EXT_REQUEST_READ";
23016 const EXTRA_CRC: u8 = 243u8;
23017 const ENCODED_LEN: usize = 20usize;
23018 fn deser(
23019 _version: MavlinkVersion,
23020 __input: &[u8],
23021 ) -> Result<Self, ::mavlink_core::error::ParserError> {
23022 let avail_len = __input.len();
23023 let mut payload_buf = [0; Self::ENCODED_LEN];
23024 let mut buf = if avail_len < Self::ENCODED_LEN {
23025 payload_buf[0..avail_len].copy_from_slice(__input);
23026 Bytes::new(&payload_buf)
23027 } else {
23028 Bytes::new(__input)
23029 };
23030 let mut __struct = Self::default();
23031 __struct.param_index = buf.get_i16_le();
23032 __struct.target_system = buf.get_u8();
23033 __struct.target_component = buf.get_u8();
23034 for v in &mut __struct.param_id {
23035 let val = buf.get_u8();
23036 *v = val;
23037 }
23038 Ok(__struct)
23039 }
23040 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
23041 let mut __tmp = BytesMut::new(bytes);
23042 #[allow(clippy::absurd_extreme_comparisons)]
23043 #[allow(unused_comparisons)]
23044 if __tmp.remaining() < Self::ENCODED_LEN {
23045 panic!(
23046 "buffer is too small (need {} bytes, but got {})",
23047 Self::ENCODED_LEN,
23048 __tmp.remaining(),
23049 )
23050 }
23051 __tmp.put_i16_le(self.param_index);
23052 __tmp.put_u8(self.target_system);
23053 __tmp.put_u8(self.target_component);
23054 for val in &self.param_id {
23055 __tmp.put_u8(*val);
23056 }
23057 if matches!(version, MavlinkVersion::V2) {
23058 let len = __tmp.len();
23059 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
23060 } else {
23061 __tmp.len()
23062 }
23063 }
23064}
23065#[doc = "Set a parameter value. In order to deal with message loss (and retransmission of PARAM_EXT_SET), when setting a parameter value and the new value is the same as the current value, you will immediately get a PARAM_ACK_ACCEPTED response. If the current state is PARAM_ACK_IN_PROGRESS, you will accordingly receive a PARAM_ACK_IN_PROGRESS in response."]
23066#[doc = ""]
23067#[doc = "ID: 323"]
23068#[derive(Debug, Clone, PartialEq)]
23069#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
23070#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
23071pub struct PARAM_EXT_SET_DATA {
23072 #[doc = "System ID"]
23073 pub target_system: u8,
23074 #[doc = "Component ID"]
23075 pub target_component: u8,
23076 #[doc = "Parameter id, terminated by NULL if the length is less than 16 human-readable chars and WITHOUT null termination (NULL) byte if the length is exactly 16 chars - applications have to provide 16+1 bytes storage if the ID is stored as string"]
23077 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
23078 pub param_id: [u8; 16],
23079 #[doc = "Parameter value"]
23080 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
23081 pub param_value: [u8; 128],
23082 #[doc = "Parameter type."]
23083 pub param_type: MavParamExtType,
23084}
23085impl PARAM_EXT_SET_DATA {
23086 pub const ENCODED_LEN: usize = 147usize;
23087 pub const DEFAULT: Self = Self {
23088 target_system: 0_u8,
23089 target_component: 0_u8,
23090 param_id: [0_u8; 16usize],
23091 param_value: [0_u8; 128usize],
23092 param_type: MavParamExtType::DEFAULT,
23093 };
23094 #[cfg(feature = "arbitrary")]
23095 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
23096 use arbitrary::{Arbitrary, Unstructured};
23097 let mut buf = [0u8; 1024];
23098 rng.fill_bytes(&mut buf);
23099 let mut unstructured = Unstructured::new(&buf);
23100 Self::arbitrary(&mut unstructured).unwrap_or_default()
23101 }
23102}
23103impl Default for PARAM_EXT_SET_DATA {
23104 fn default() -> Self {
23105 Self::DEFAULT.clone()
23106 }
23107}
23108impl MessageData for PARAM_EXT_SET_DATA {
23109 type Message = MavMessage;
23110 const ID: u32 = 323u32;
23111 const NAME: &'static str = "PARAM_EXT_SET";
23112 const EXTRA_CRC: u8 = 78u8;
23113 const ENCODED_LEN: usize = 147usize;
23114 fn deser(
23115 _version: MavlinkVersion,
23116 __input: &[u8],
23117 ) -> Result<Self, ::mavlink_core::error::ParserError> {
23118 let avail_len = __input.len();
23119 let mut payload_buf = [0; Self::ENCODED_LEN];
23120 let mut buf = if avail_len < Self::ENCODED_LEN {
23121 payload_buf[0..avail_len].copy_from_slice(__input);
23122 Bytes::new(&payload_buf)
23123 } else {
23124 Bytes::new(__input)
23125 };
23126 let mut __struct = Self::default();
23127 __struct.target_system = buf.get_u8();
23128 __struct.target_component = buf.get_u8();
23129 for v in &mut __struct.param_id {
23130 let val = buf.get_u8();
23131 *v = val;
23132 }
23133 for v in &mut __struct.param_value {
23134 let val = buf.get_u8();
23135 *v = val;
23136 }
23137 let tmp = buf.get_u8();
23138 __struct.param_type =
23139 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
23140 enum_type: "MavParamExtType",
23141 value: tmp as u32,
23142 })?;
23143 Ok(__struct)
23144 }
23145 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
23146 let mut __tmp = BytesMut::new(bytes);
23147 #[allow(clippy::absurd_extreme_comparisons)]
23148 #[allow(unused_comparisons)]
23149 if __tmp.remaining() < Self::ENCODED_LEN {
23150 panic!(
23151 "buffer is too small (need {} bytes, but got {})",
23152 Self::ENCODED_LEN,
23153 __tmp.remaining(),
23154 )
23155 }
23156 __tmp.put_u8(self.target_system);
23157 __tmp.put_u8(self.target_component);
23158 for val in &self.param_id {
23159 __tmp.put_u8(*val);
23160 }
23161 for val in &self.param_value {
23162 __tmp.put_u8(*val);
23163 }
23164 __tmp.put_u8(self.param_type as u8);
23165 if matches!(version, MavlinkVersion::V2) {
23166 let len = __tmp.len();
23167 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
23168 } else {
23169 __tmp.len()
23170 }
23171 }
23172}
23173#[doc = "Emit the value of a parameter. The inclusion of param_count and param_index in the message allows the recipient to keep track of received parameters and allows them to re-request missing parameters after a loss or timeout."]
23174#[doc = ""]
23175#[doc = "ID: 322"]
23176#[derive(Debug, Clone, PartialEq)]
23177#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
23178#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
23179pub struct PARAM_EXT_VALUE_DATA {
23180 #[doc = "Total number of parameters"]
23181 pub param_count: u16,
23182 #[doc = "Index of this parameter"]
23183 pub param_index: u16,
23184 #[doc = "Parameter id, terminated by NULL if the length is less than 16 human-readable chars and WITHOUT null termination (NULL) byte if the length is exactly 16 chars - applications have to provide 16+1 bytes storage if the ID is stored as string"]
23185 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
23186 pub param_id: [u8; 16],
23187 #[doc = "Parameter value"]
23188 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
23189 pub param_value: [u8; 128],
23190 #[doc = "Parameter type."]
23191 pub param_type: MavParamExtType,
23192}
23193impl PARAM_EXT_VALUE_DATA {
23194 pub const ENCODED_LEN: usize = 149usize;
23195 pub const DEFAULT: Self = Self {
23196 param_count: 0_u16,
23197 param_index: 0_u16,
23198 param_id: [0_u8; 16usize],
23199 param_value: [0_u8; 128usize],
23200 param_type: MavParamExtType::DEFAULT,
23201 };
23202 #[cfg(feature = "arbitrary")]
23203 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
23204 use arbitrary::{Arbitrary, Unstructured};
23205 let mut buf = [0u8; 1024];
23206 rng.fill_bytes(&mut buf);
23207 let mut unstructured = Unstructured::new(&buf);
23208 Self::arbitrary(&mut unstructured).unwrap_or_default()
23209 }
23210}
23211impl Default for PARAM_EXT_VALUE_DATA {
23212 fn default() -> Self {
23213 Self::DEFAULT.clone()
23214 }
23215}
23216impl MessageData for PARAM_EXT_VALUE_DATA {
23217 type Message = MavMessage;
23218 const ID: u32 = 322u32;
23219 const NAME: &'static str = "PARAM_EXT_VALUE";
23220 const EXTRA_CRC: u8 = 243u8;
23221 const ENCODED_LEN: usize = 149usize;
23222 fn deser(
23223 _version: MavlinkVersion,
23224 __input: &[u8],
23225 ) -> Result<Self, ::mavlink_core::error::ParserError> {
23226 let avail_len = __input.len();
23227 let mut payload_buf = [0; Self::ENCODED_LEN];
23228 let mut buf = if avail_len < Self::ENCODED_LEN {
23229 payload_buf[0..avail_len].copy_from_slice(__input);
23230 Bytes::new(&payload_buf)
23231 } else {
23232 Bytes::new(__input)
23233 };
23234 let mut __struct = Self::default();
23235 __struct.param_count = buf.get_u16_le();
23236 __struct.param_index = buf.get_u16_le();
23237 for v in &mut __struct.param_id {
23238 let val = buf.get_u8();
23239 *v = val;
23240 }
23241 for v in &mut __struct.param_value {
23242 let val = buf.get_u8();
23243 *v = val;
23244 }
23245 let tmp = buf.get_u8();
23246 __struct.param_type =
23247 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
23248 enum_type: "MavParamExtType",
23249 value: tmp as u32,
23250 })?;
23251 Ok(__struct)
23252 }
23253 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
23254 let mut __tmp = BytesMut::new(bytes);
23255 #[allow(clippy::absurd_extreme_comparisons)]
23256 #[allow(unused_comparisons)]
23257 if __tmp.remaining() < Self::ENCODED_LEN {
23258 panic!(
23259 "buffer is too small (need {} bytes, but got {})",
23260 Self::ENCODED_LEN,
23261 __tmp.remaining(),
23262 )
23263 }
23264 __tmp.put_u16_le(self.param_count);
23265 __tmp.put_u16_le(self.param_index);
23266 for val in &self.param_id {
23267 __tmp.put_u8(*val);
23268 }
23269 for val in &self.param_value {
23270 __tmp.put_u8(*val);
23271 }
23272 __tmp.put_u8(self.param_type as u8);
23273 if matches!(version, MavlinkVersion::V2) {
23274 let len = __tmp.len();
23275 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
23276 } else {
23277 __tmp.len()
23278 }
23279 }
23280}
23281#[doc = "Bind a RC channel to a parameter. The parameter should change according to the RC channel value."]
23282#[doc = ""]
23283#[doc = "ID: 50"]
23284#[derive(Debug, Clone, PartialEq)]
23285#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
23286#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
23287pub struct PARAM_MAP_RC_DATA {
23288 #[doc = "Initial parameter value"]
23289 pub param_value0: f32,
23290 #[doc = "Scale, maps the RC range [-1, 1] to a parameter value"]
23291 pub scale: f32,
23292 #[doc = "Minimum param value. The protocol does not define if this overwrites an onboard minimum value. (Depends on implementation)"]
23293 pub param_value_min: f32,
23294 #[doc = "Maximum param value. The protocol does not define if this overwrites an onboard maximum value. (Depends on implementation)"]
23295 pub param_value_max: f32,
23296 #[doc = "Parameter index. Send -1 to use the param ID field as identifier (else the param id will be ignored), send -2 to disable any existing map for this rc_channel_index."]
23297 pub param_index: i16,
23298 #[doc = "System ID"]
23299 pub target_system: u8,
23300 #[doc = "Component ID"]
23301 pub target_component: u8,
23302 #[doc = "Onboard parameter id, terminated by NULL if the length is less than 16 human-readable chars and WITHOUT null termination (NULL) byte if the length is exactly 16 chars - applications have to provide 16+1 bytes storage if the ID is stored as string"]
23303 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
23304 pub param_id: [u8; 16],
23305 #[doc = "Index of parameter RC channel. Not equal to the RC channel id. Typically corresponds to a potentiometer-knob on the RC."]
23306 pub parameter_rc_channel_index: u8,
23307}
23308impl PARAM_MAP_RC_DATA {
23309 pub const ENCODED_LEN: usize = 37usize;
23310 pub const DEFAULT: Self = Self {
23311 param_value0: 0.0_f32,
23312 scale: 0.0_f32,
23313 param_value_min: 0.0_f32,
23314 param_value_max: 0.0_f32,
23315 param_index: 0_i16,
23316 target_system: 0_u8,
23317 target_component: 0_u8,
23318 param_id: [0_u8; 16usize],
23319 parameter_rc_channel_index: 0_u8,
23320 };
23321 #[cfg(feature = "arbitrary")]
23322 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
23323 use arbitrary::{Arbitrary, Unstructured};
23324 let mut buf = [0u8; 1024];
23325 rng.fill_bytes(&mut buf);
23326 let mut unstructured = Unstructured::new(&buf);
23327 Self::arbitrary(&mut unstructured).unwrap_or_default()
23328 }
23329}
23330impl Default for PARAM_MAP_RC_DATA {
23331 fn default() -> Self {
23332 Self::DEFAULT.clone()
23333 }
23334}
23335impl MessageData for PARAM_MAP_RC_DATA {
23336 type Message = MavMessage;
23337 const ID: u32 = 50u32;
23338 const NAME: &'static str = "PARAM_MAP_RC";
23339 const EXTRA_CRC: u8 = 78u8;
23340 const ENCODED_LEN: usize = 37usize;
23341 fn deser(
23342 _version: MavlinkVersion,
23343 __input: &[u8],
23344 ) -> Result<Self, ::mavlink_core::error::ParserError> {
23345 let avail_len = __input.len();
23346 let mut payload_buf = [0; Self::ENCODED_LEN];
23347 let mut buf = if avail_len < Self::ENCODED_LEN {
23348 payload_buf[0..avail_len].copy_from_slice(__input);
23349 Bytes::new(&payload_buf)
23350 } else {
23351 Bytes::new(__input)
23352 };
23353 let mut __struct = Self::default();
23354 __struct.param_value0 = buf.get_f32_le();
23355 __struct.scale = buf.get_f32_le();
23356 __struct.param_value_min = buf.get_f32_le();
23357 __struct.param_value_max = buf.get_f32_le();
23358 __struct.param_index = buf.get_i16_le();
23359 __struct.target_system = buf.get_u8();
23360 __struct.target_component = buf.get_u8();
23361 for v in &mut __struct.param_id {
23362 let val = buf.get_u8();
23363 *v = val;
23364 }
23365 __struct.parameter_rc_channel_index = buf.get_u8();
23366 Ok(__struct)
23367 }
23368 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
23369 let mut __tmp = BytesMut::new(bytes);
23370 #[allow(clippy::absurd_extreme_comparisons)]
23371 #[allow(unused_comparisons)]
23372 if __tmp.remaining() < Self::ENCODED_LEN {
23373 panic!(
23374 "buffer is too small (need {} bytes, but got {})",
23375 Self::ENCODED_LEN,
23376 __tmp.remaining(),
23377 )
23378 }
23379 __tmp.put_f32_le(self.param_value0);
23380 __tmp.put_f32_le(self.scale);
23381 __tmp.put_f32_le(self.param_value_min);
23382 __tmp.put_f32_le(self.param_value_max);
23383 __tmp.put_i16_le(self.param_index);
23384 __tmp.put_u8(self.target_system);
23385 __tmp.put_u8(self.target_component);
23386 for val in &self.param_id {
23387 __tmp.put_u8(*val);
23388 }
23389 __tmp.put_u8(self.parameter_rc_channel_index);
23390 if matches!(version, MavlinkVersion::V2) {
23391 let len = __tmp.len();
23392 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
23393 } else {
23394 __tmp.len()
23395 }
23396 }
23397}
23398#[doc = "Request all parameters of this component. After this request, all parameters are emitted. The parameter microservice is documented at <https://mavlink.io/en/services/parameter.html>."]
23399#[doc = ""]
23400#[doc = "ID: 21"]
23401#[derive(Debug, Clone, PartialEq)]
23402#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
23403#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
23404pub struct PARAM_REQUEST_LIST_DATA {
23405 #[doc = "System ID"]
23406 pub target_system: u8,
23407 #[doc = "Component ID"]
23408 pub target_component: u8,
23409}
23410impl PARAM_REQUEST_LIST_DATA {
23411 pub const ENCODED_LEN: usize = 2usize;
23412 pub const DEFAULT: Self = Self {
23413 target_system: 0_u8,
23414 target_component: 0_u8,
23415 };
23416 #[cfg(feature = "arbitrary")]
23417 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
23418 use arbitrary::{Arbitrary, Unstructured};
23419 let mut buf = [0u8; 1024];
23420 rng.fill_bytes(&mut buf);
23421 let mut unstructured = Unstructured::new(&buf);
23422 Self::arbitrary(&mut unstructured).unwrap_or_default()
23423 }
23424}
23425impl Default for PARAM_REQUEST_LIST_DATA {
23426 fn default() -> Self {
23427 Self::DEFAULT.clone()
23428 }
23429}
23430impl MessageData for PARAM_REQUEST_LIST_DATA {
23431 type Message = MavMessage;
23432 const ID: u32 = 21u32;
23433 const NAME: &'static str = "PARAM_REQUEST_LIST";
23434 const EXTRA_CRC: u8 = 159u8;
23435 const ENCODED_LEN: usize = 2usize;
23436 fn deser(
23437 _version: MavlinkVersion,
23438 __input: &[u8],
23439 ) -> Result<Self, ::mavlink_core::error::ParserError> {
23440 let avail_len = __input.len();
23441 let mut payload_buf = [0; Self::ENCODED_LEN];
23442 let mut buf = if avail_len < Self::ENCODED_LEN {
23443 payload_buf[0..avail_len].copy_from_slice(__input);
23444 Bytes::new(&payload_buf)
23445 } else {
23446 Bytes::new(__input)
23447 };
23448 let mut __struct = Self::default();
23449 __struct.target_system = buf.get_u8();
23450 __struct.target_component = buf.get_u8();
23451 Ok(__struct)
23452 }
23453 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
23454 let mut __tmp = BytesMut::new(bytes);
23455 #[allow(clippy::absurd_extreme_comparisons)]
23456 #[allow(unused_comparisons)]
23457 if __tmp.remaining() < Self::ENCODED_LEN {
23458 panic!(
23459 "buffer is too small (need {} bytes, but got {})",
23460 Self::ENCODED_LEN,
23461 __tmp.remaining(),
23462 )
23463 }
23464 __tmp.put_u8(self.target_system);
23465 __tmp.put_u8(self.target_component);
23466 if matches!(version, MavlinkVersion::V2) {
23467 let len = __tmp.len();
23468 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
23469 } else {
23470 __tmp.len()
23471 }
23472 }
23473}
23474#[doc = "value[float]. This allows to send a parameter to any other component (such as the GCS) without the need of previous knowledge of possible parameter names. Thus the same GCS can store different parameters for different autopilots. See also <https://mavlink.io/en/services/parameter.html> for a full documentation of QGroundControl and IMU code."]
23475#[doc = ""]
23476#[doc = "ID: 20"]
23477#[derive(Debug, Clone, PartialEq)]
23478#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
23479#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
23480pub struct PARAM_REQUEST_READ_DATA {
23481 #[doc = "Parameter index. Send -1 to use the param ID field as identifier (else the param id will be ignored)"]
23482 pub param_index: i16,
23483 #[doc = "System ID"]
23484 pub target_system: u8,
23485 #[doc = "Component ID"]
23486 pub target_component: u8,
23487 #[doc = "Onboard parameter id, terminated by NULL if the length is less than 16 human-readable chars and WITHOUT null termination (NULL) byte if the length is exactly 16 chars - applications have to provide 16+1 bytes storage if the ID is stored as string"]
23488 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
23489 pub param_id: [u8; 16],
23490}
23491impl PARAM_REQUEST_READ_DATA {
23492 pub const ENCODED_LEN: usize = 20usize;
23493 pub const DEFAULT: Self = Self {
23494 param_index: 0_i16,
23495 target_system: 0_u8,
23496 target_component: 0_u8,
23497 param_id: [0_u8; 16usize],
23498 };
23499 #[cfg(feature = "arbitrary")]
23500 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
23501 use arbitrary::{Arbitrary, Unstructured};
23502 let mut buf = [0u8; 1024];
23503 rng.fill_bytes(&mut buf);
23504 let mut unstructured = Unstructured::new(&buf);
23505 Self::arbitrary(&mut unstructured).unwrap_or_default()
23506 }
23507}
23508impl Default for PARAM_REQUEST_READ_DATA {
23509 fn default() -> Self {
23510 Self::DEFAULT.clone()
23511 }
23512}
23513impl MessageData for PARAM_REQUEST_READ_DATA {
23514 type Message = MavMessage;
23515 const ID: u32 = 20u32;
23516 const NAME: &'static str = "PARAM_REQUEST_READ";
23517 const EXTRA_CRC: u8 = 214u8;
23518 const ENCODED_LEN: usize = 20usize;
23519 fn deser(
23520 _version: MavlinkVersion,
23521 __input: &[u8],
23522 ) -> Result<Self, ::mavlink_core::error::ParserError> {
23523 let avail_len = __input.len();
23524 let mut payload_buf = [0; Self::ENCODED_LEN];
23525 let mut buf = if avail_len < Self::ENCODED_LEN {
23526 payload_buf[0..avail_len].copy_from_slice(__input);
23527 Bytes::new(&payload_buf)
23528 } else {
23529 Bytes::new(__input)
23530 };
23531 let mut __struct = Self::default();
23532 __struct.param_index = buf.get_i16_le();
23533 __struct.target_system = buf.get_u8();
23534 __struct.target_component = buf.get_u8();
23535 for v in &mut __struct.param_id {
23536 let val = buf.get_u8();
23537 *v = val;
23538 }
23539 Ok(__struct)
23540 }
23541 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
23542 let mut __tmp = BytesMut::new(bytes);
23543 #[allow(clippy::absurd_extreme_comparisons)]
23544 #[allow(unused_comparisons)]
23545 if __tmp.remaining() < Self::ENCODED_LEN {
23546 panic!(
23547 "buffer is too small (need {} bytes, but got {})",
23548 Self::ENCODED_LEN,
23549 __tmp.remaining(),
23550 )
23551 }
23552 __tmp.put_i16_le(self.param_index);
23553 __tmp.put_u8(self.target_system);
23554 __tmp.put_u8(self.target_component);
23555 for val in &self.param_id {
23556 __tmp.put_u8(*val);
23557 }
23558 if matches!(version, MavlinkVersion::V2) {
23559 let len = __tmp.len();
23560 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
23561 } else {
23562 __tmp.len()
23563 }
23564 }
23565}
23566#[doc = "Set a parameter value (write new value to permanent storage). The receiving component should acknowledge the new parameter value by broadcasting a PARAM_VALUE message (broadcasting ensures that multiple GCS all have an up-to-date list of all parameters). If the sending GCS did not receive a PARAM_VALUE within its timeout time, it should re-send the PARAM_SET message. The parameter microservice is documented at <https://mavlink.io/en/services/parameter.html>."]
23567#[doc = ""]
23568#[doc = "ID: 23"]
23569#[derive(Debug, Clone, PartialEq)]
23570#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
23571#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
23572pub struct PARAM_SET_DATA {
23573 #[doc = "Onboard parameter value"]
23574 pub param_value: f32,
23575 #[doc = "System ID"]
23576 pub target_system: u8,
23577 #[doc = "Component ID"]
23578 pub target_component: u8,
23579 #[doc = "Onboard parameter id, terminated by NULL if the length is less than 16 human-readable chars and WITHOUT null termination (NULL) byte if the length is exactly 16 chars - applications have to provide 16+1 bytes storage if the ID is stored as string"]
23580 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
23581 pub param_id: [u8; 16],
23582 #[doc = "Onboard parameter type."]
23583 pub param_type: MavParamType,
23584}
23585impl PARAM_SET_DATA {
23586 pub const ENCODED_LEN: usize = 23usize;
23587 pub const DEFAULT: Self = Self {
23588 param_value: 0.0_f32,
23589 target_system: 0_u8,
23590 target_component: 0_u8,
23591 param_id: [0_u8; 16usize],
23592 param_type: MavParamType::DEFAULT,
23593 };
23594 #[cfg(feature = "arbitrary")]
23595 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
23596 use arbitrary::{Arbitrary, Unstructured};
23597 let mut buf = [0u8; 1024];
23598 rng.fill_bytes(&mut buf);
23599 let mut unstructured = Unstructured::new(&buf);
23600 Self::arbitrary(&mut unstructured).unwrap_or_default()
23601 }
23602}
23603impl Default for PARAM_SET_DATA {
23604 fn default() -> Self {
23605 Self::DEFAULT.clone()
23606 }
23607}
23608impl MessageData for PARAM_SET_DATA {
23609 type Message = MavMessage;
23610 const ID: u32 = 23u32;
23611 const NAME: &'static str = "PARAM_SET";
23612 const EXTRA_CRC: u8 = 168u8;
23613 const ENCODED_LEN: usize = 23usize;
23614 fn deser(
23615 _version: MavlinkVersion,
23616 __input: &[u8],
23617 ) -> Result<Self, ::mavlink_core::error::ParserError> {
23618 let avail_len = __input.len();
23619 let mut payload_buf = [0; Self::ENCODED_LEN];
23620 let mut buf = if avail_len < Self::ENCODED_LEN {
23621 payload_buf[0..avail_len].copy_from_slice(__input);
23622 Bytes::new(&payload_buf)
23623 } else {
23624 Bytes::new(__input)
23625 };
23626 let mut __struct = Self::default();
23627 __struct.param_value = buf.get_f32_le();
23628 __struct.target_system = buf.get_u8();
23629 __struct.target_component = buf.get_u8();
23630 for v in &mut __struct.param_id {
23631 let val = buf.get_u8();
23632 *v = val;
23633 }
23634 let tmp = buf.get_u8();
23635 __struct.param_type =
23636 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
23637 enum_type: "MavParamType",
23638 value: tmp as u32,
23639 })?;
23640 Ok(__struct)
23641 }
23642 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
23643 let mut __tmp = BytesMut::new(bytes);
23644 #[allow(clippy::absurd_extreme_comparisons)]
23645 #[allow(unused_comparisons)]
23646 if __tmp.remaining() < Self::ENCODED_LEN {
23647 panic!(
23648 "buffer is too small (need {} bytes, but got {})",
23649 Self::ENCODED_LEN,
23650 __tmp.remaining(),
23651 )
23652 }
23653 __tmp.put_f32_le(self.param_value);
23654 __tmp.put_u8(self.target_system);
23655 __tmp.put_u8(self.target_component);
23656 for val in &self.param_id {
23657 __tmp.put_u8(*val);
23658 }
23659 __tmp.put_u8(self.param_type as u8);
23660 if matches!(version, MavlinkVersion::V2) {
23661 let len = __tmp.len();
23662 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
23663 } else {
23664 __tmp.len()
23665 }
23666 }
23667}
23668#[doc = "Emit the value of a onboard parameter. The inclusion of param_count and param_index in the message allows the recipient to keep track of received parameters and allows him to re-request missing parameters after a loss or timeout. The parameter microservice is documented at <https://mavlink.io/en/services/parameter.html>."]
23669#[doc = ""]
23670#[doc = "ID: 22"]
23671#[derive(Debug, Clone, PartialEq)]
23672#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
23673#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
23674pub struct PARAM_VALUE_DATA {
23675 #[doc = "Onboard parameter value"]
23676 pub param_value: f32,
23677 #[doc = "Total number of onboard parameters"]
23678 pub param_count: u16,
23679 #[doc = "Index of this onboard parameter"]
23680 pub param_index: u16,
23681 #[doc = "Onboard parameter id, terminated by NULL if the length is less than 16 human-readable chars and WITHOUT null termination (NULL) byte if the length is exactly 16 chars - applications have to provide 16+1 bytes storage if the ID is stored as string"]
23682 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
23683 pub param_id: [u8; 16],
23684 #[doc = "Onboard parameter type."]
23685 pub param_type: MavParamType,
23686}
23687impl PARAM_VALUE_DATA {
23688 pub const ENCODED_LEN: usize = 25usize;
23689 pub const DEFAULT: Self = Self {
23690 param_value: 0.0_f32,
23691 param_count: 0_u16,
23692 param_index: 0_u16,
23693 param_id: [0_u8; 16usize],
23694 param_type: MavParamType::DEFAULT,
23695 };
23696 #[cfg(feature = "arbitrary")]
23697 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
23698 use arbitrary::{Arbitrary, Unstructured};
23699 let mut buf = [0u8; 1024];
23700 rng.fill_bytes(&mut buf);
23701 let mut unstructured = Unstructured::new(&buf);
23702 Self::arbitrary(&mut unstructured).unwrap_or_default()
23703 }
23704}
23705impl Default for PARAM_VALUE_DATA {
23706 fn default() -> Self {
23707 Self::DEFAULT.clone()
23708 }
23709}
23710impl MessageData for PARAM_VALUE_DATA {
23711 type Message = MavMessage;
23712 const ID: u32 = 22u32;
23713 const NAME: &'static str = "PARAM_VALUE";
23714 const EXTRA_CRC: u8 = 220u8;
23715 const ENCODED_LEN: usize = 25usize;
23716 fn deser(
23717 _version: MavlinkVersion,
23718 __input: &[u8],
23719 ) -> Result<Self, ::mavlink_core::error::ParserError> {
23720 let avail_len = __input.len();
23721 let mut payload_buf = [0; Self::ENCODED_LEN];
23722 let mut buf = if avail_len < Self::ENCODED_LEN {
23723 payload_buf[0..avail_len].copy_from_slice(__input);
23724 Bytes::new(&payload_buf)
23725 } else {
23726 Bytes::new(__input)
23727 };
23728 let mut __struct = Self::default();
23729 __struct.param_value = buf.get_f32_le();
23730 __struct.param_count = buf.get_u16_le();
23731 __struct.param_index = buf.get_u16_le();
23732 for v in &mut __struct.param_id {
23733 let val = buf.get_u8();
23734 *v = val;
23735 }
23736 let tmp = buf.get_u8();
23737 __struct.param_type =
23738 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
23739 enum_type: "MavParamType",
23740 value: tmp as u32,
23741 })?;
23742 Ok(__struct)
23743 }
23744 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
23745 let mut __tmp = BytesMut::new(bytes);
23746 #[allow(clippy::absurd_extreme_comparisons)]
23747 #[allow(unused_comparisons)]
23748 if __tmp.remaining() < Self::ENCODED_LEN {
23749 panic!(
23750 "buffer is too small (need {} bytes, but got {})",
23751 Self::ENCODED_LEN,
23752 __tmp.remaining(),
23753 )
23754 }
23755 __tmp.put_f32_le(self.param_value);
23756 __tmp.put_u16_le(self.param_count);
23757 __tmp.put_u16_le(self.param_index);
23758 for val in &self.param_id {
23759 __tmp.put_u8(*val);
23760 }
23761 __tmp.put_u8(self.param_type as u8);
23762 if matches!(version, MavlinkVersion::V2) {
23763 let len = __tmp.len();
23764 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
23765 } else {
23766 __tmp.len()
23767 }
23768 }
23769}
23770#[deprecated = "To be removed / merged with TIMESYNC. See `TIMESYNC` (Deprecated since 2011-08)"]
23771#[doc = "A ping message either requesting or responding to a ping. This allows to measure the system latencies, including serial port, radio modem and UDP connections. The ping microservice is documented at <https://mavlink.io/en/services/ping.html>."]
23772#[doc = ""]
23773#[doc = "ID: 4"]
23774#[derive(Debug, Clone, PartialEq)]
23775#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
23776#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
23777pub struct PING_DATA {
23778 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
23779 pub time_usec: u64,
23780 #[doc = "PING sequence"]
23781 pub seq: u32,
23782 #[doc = "0: request ping from all receiving systems. If greater than 0: message is a ping response and number is the system id of the requesting system"]
23783 pub target_system: u8,
23784 #[doc = "0: request ping from all receiving components. If greater than 0: message is a ping response and number is the component id of the requesting component."]
23785 pub target_component: u8,
23786}
23787impl PING_DATA {
23788 pub const ENCODED_LEN: usize = 14usize;
23789 pub const DEFAULT: Self = Self {
23790 time_usec: 0_u64,
23791 seq: 0_u32,
23792 target_system: 0_u8,
23793 target_component: 0_u8,
23794 };
23795 #[cfg(feature = "arbitrary")]
23796 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
23797 use arbitrary::{Arbitrary, Unstructured};
23798 let mut buf = [0u8; 1024];
23799 rng.fill_bytes(&mut buf);
23800 let mut unstructured = Unstructured::new(&buf);
23801 Self::arbitrary(&mut unstructured).unwrap_or_default()
23802 }
23803}
23804impl Default for PING_DATA {
23805 fn default() -> Self {
23806 Self::DEFAULT.clone()
23807 }
23808}
23809impl MessageData for PING_DATA {
23810 type Message = MavMessage;
23811 const ID: u32 = 4u32;
23812 const NAME: &'static str = "PING";
23813 const EXTRA_CRC: u8 = 237u8;
23814 const ENCODED_LEN: usize = 14usize;
23815 fn deser(
23816 _version: MavlinkVersion,
23817 __input: &[u8],
23818 ) -> Result<Self, ::mavlink_core::error::ParserError> {
23819 let avail_len = __input.len();
23820 let mut payload_buf = [0; Self::ENCODED_LEN];
23821 let mut buf = if avail_len < Self::ENCODED_LEN {
23822 payload_buf[0..avail_len].copy_from_slice(__input);
23823 Bytes::new(&payload_buf)
23824 } else {
23825 Bytes::new(__input)
23826 };
23827 let mut __struct = Self::default();
23828 __struct.time_usec = buf.get_u64_le();
23829 __struct.seq = buf.get_u32_le();
23830 __struct.target_system = buf.get_u8();
23831 __struct.target_component = buf.get_u8();
23832 Ok(__struct)
23833 }
23834 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
23835 let mut __tmp = BytesMut::new(bytes);
23836 #[allow(clippy::absurd_extreme_comparisons)]
23837 #[allow(unused_comparisons)]
23838 if __tmp.remaining() < Self::ENCODED_LEN {
23839 panic!(
23840 "buffer is too small (need {} bytes, but got {})",
23841 Self::ENCODED_LEN,
23842 __tmp.remaining(),
23843 )
23844 }
23845 __tmp.put_u64_le(self.time_usec);
23846 __tmp.put_u32_le(self.seq);
23847 __tmp.put_u8(self.target_system);
23848 __tmp.put_u8(self.target_component);
23849 if matches!(version, MavlinkVersion::V2) {
23850 let len = __tmp.len();
23851 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
23852 } else {
23853 __tmp.len()
23854 }
23855 }
23856}
23857#[deprecated = "New version explicitly defines format. More interoperable. See `PLAY_TUNE_V2` (Deprecated since 2019-10)"]
23858#[doc = "Control vehicle tone generation (buzzer)."]
23859#[doc = ""]
23860#[doc = "ID: 258"]
23861#[derive(Debug, Clone, PartialEq)]
23862#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
23863#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
23864pub struct PLAY_TUNE_DATA {
23865 #[doc = "System ID"]
23866 pub target_system: u8,
23867 #[doc = "Component ID"]
23868 pub target_component: u8,
23869 #[doc = "tune in board specific format"]
23870 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
23871 pub tune: [u8; 30],
23872 #[doc = "tune extension (appended to tune)"]
23873 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
23874 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
23875 pub tune2: [u8; 200],
23876}
23877impl PLAY_TUNE_DATA {
23878 pub const ENCODED_LEN: usize = 232usize;
23879 pub const DEFAULT: Self = Self {
23880 target_system: 0_u8,
23881 target_component: 0_u8,
23882 tune: [0_u8; 30usize],
23883 tune2: [0_u8; 200usize],
23884 };
23885 #[cfg(feature = "arbitrary")]
23886 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
23887 use arbitrary::{Arbitrary, Unstructured};
23888 let mut buf = [0u8; 1024];
23889 rng.fill_bytes(&mut buf);
23890 let mut unstructured = Unstructured::new(&buf);
23891 Self::arbitrary(&mut unstructured).unwrap_or_default()
23892 }
23893}
23894impl Default for PLAY_TUNE_DATA {
23895 fn default() -> Self {
23896 Self::DEFAULT.clone()
23897 }
23898}
23899impl MessageData for PLAY_TUNE_DATA {
23900 type Message = MavMessage;
23901 const ID: u32 = 258u32;
23902 const NAME: &'static str = "PLAY_TUNE";
23903 const EXTRA_CRC: u8 = 187u8;
23904 const ENCODED_LEN: usize = 232usize;
23905 fn deser(
23906 _version: MavlinkVersion,
23907 __input: &[u8],
23908 ) -> Result<Self, ::mavlink_core::error::ParserError> {
23909 let avail_len = __input.len();
23910 let mut payload_buf = [0; Self::ENCODED_LEN];
23911 let mut buf = if avail_len < Self::ENCODED_LEN {
23912 payload_buf[0..avail_len].copy_from_slice(__input);
23913 Bytes::new(&payload_buf)
23914 } else {
23915 Bytes::new(__input)
23916 };
23917 let mut __struct = Self::default();
23918 __struct.target_system = buf.get_u8();
23919 __struct.target_component = buf.get_u8();
23920 for v in &mut __struct.tune {
23921 let val = buf.get_u8();
23922 *v = val;
23923 }
23924 for v in &mut __struct.tune2 {
23925 let val = buf.get_u8();
23926 *v = val;
23927 }
23928 Ok(__struct)
23929 }
23930 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
23931 let mut __tmp = BytesMut::new(bytes);
23932 #[allow(clippy::absurd_extreme_comparisons)]
23933 #[allow(unused_comparisons)]
23934 if __tmp.remaining() < Self::ENCODED_LEN {
23935 panic!(
23936 "buffer is too small (need {} bytes, but got {})",
23937 Self::ENCODED_LEN,
23938 __tmp.remaining(),
23939 )
23940 }
23941 __tmp.put_u8(self.target_system);
23942 __tmp.put_u8(self.target_component);
23943 for val in &self.tune {
23944 __tmp.put_u8(*val);
23945 }
23946 if matches!(version, MavlinkVersion::V2) {
23947 for val in &self.tune2 {
23948 __tmp.put_u8(*val);
23949 }
23950 let len = __tmp.len();
23951 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
23952 } else {
23953 __tmp.len()
23954 }
23955 }
23956}
23957#[doc = "Play vehicle tone/tune (buzzer). Supersedes message PLAY_TUNE."]
23958#[doc = ""]
23959#[doc = "ID: 400"]
23960#[derive(Debug, Clone, PartialEq)]
23961#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
23962#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
23963pub struct PLAY_TUNE_V2_DATA {
23964 #[doc = "Tune format"]
23965 pub format: TuneFormat,
23966 #[doc = "System ID"]
23967 pub target_system: u8,
23968 #[doc = "Component ID"]
23969 pub target_component: u8,
23970 #[doc = "Tune definition as a NULL-terminated string."]
23971 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
23972 pub tune: [u8; 248],
23973}
23974impl PLAY_TUNE_V2_DATA {
23975 pub const ENCODED_LEN: usize = 254usize;
23976 pub const DEFAULT: Self = Self {
23977 format: TuneFormat::DEFAULT,
23978 target_system: 0_u8,
23979 target_component: 0_u8,
23980 tune: [0_u8; 248usize],
23981 };
23982 #[cfg(feature = "arbitrary")]
23983 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
23984 use arbitrary::{Arbitrary, Unstructured};
23985 let mut buf = [0u8; 1024];
23986 rng.fill_bytes(&mut buf);
23987 let mut unstructured = Unstructured::new(&buf);
23988 Self::arbitrary(&mut unstructured).unwrap_or_default()
23989 }
23990}
23991impl Default for PLAY_TUNE_V2_DATA {
23992 fn default() -> Self {
23993 Self::DEFAULT.clone()
23994 }
23995}
23996impl MessageData for PLAY_TUNE_V2_DATA {
23997 type Message = MavMessage;
23998 const ID: u32 = 400u32;
23999 const NAME: &'static str = "PLAY_TUNE_V2";
24000 const EXTRA_CRC: u8 = 110u8;
24001 const ENCODED_LEN: usize = 254usize;
24002 fn deser(
24003 _version: MavlinkVersion,
24004 __input: &[u8],
24005 ) -> Result<Self, ::mavlink_core::error::ParserError> {
24006 let avail_len = __input.len();
24007 let mut payload_buf = [0; Self::ENCODED_LEN];
24008 let mut buf = if avail_len < Self::ENCODED_LEN {
24009 payload_buf[0..avail_len].copy_from_slice(__input);
24010 Bytes::new(&payload_buf)
24011 } else {
24012 Bytes::new(__input)
24013 };
24014 let mut __struct = Self::default();
24015 let tmp = buf.get_u32_le();
24016 __struct.format = FromPrimitive::from_u32(tmp).ok_or(
24017 ::mavlink_core::error::ParserError::InvalidEnum {
24018 enum_type: "TuneFormat",
24019 value: tmp as u32,
24020 },
24021 )?;
24022 __struct.target_system = buf.get_u8();
24023 __struct.target_component = buf.get_u8();
24024 for v in &mut __struct.tune {
24025 let val = buf.get_u8();
24026 *v = val;
24027 }
24028 Ok(__struct)
24029 }
24030 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
24031 let mut __tmp = BytesMut::new(bytes);
24032 #[allow(clippy::absurd_extreme_comparisons)]
24033 #[allow(unused_comparisons)]
24034 if __tmp.remaining() < Self::ENCODED_LEN {
24035 panic!(
24036 "buffer is too small (need {} bytes, but got {})",
24037 Self::ENCODED_LEN,
24038 __tmp.remaining(),
24039 )
24040 }
24041 __tmp.put_u32_le(self.format as u32);
24042 __tmp.put_u8(self.target_system);
24043 __tmp.put_u8(self.target_component);
24044 for val in &self.tune {
24045 __tmp.put_u8(*val);
24046 }
24047 if matches!(version, MavlinkVersion::V2) {
24048 let len = __tmp.len();
24049 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
24050 } else {
24051 __tmp.len()
24052 }
24053 }
24054}
24055#[doc = "Reports the current commanded vehicle position, velocity, and acceleration as specified by the autopilot. This should match the commands sent in SET_POSITION_TARGET_GLOBAL_INT if the vehicle is being controlled this way."]
24056#[doc = ""]
24057#[doc = "ID: 87"]
24058#[derive(Debug, Clone, PartialEq)]
24059#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
24060#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
24061pub struct POSITION_TARGET_GLOBAL_INT_DATA {
24062 #[doc = "Timestamp (time since system boot). The rationale for the timestamp in the setpoint is to allow the system to compensate for the transport delay of the setpoint. This allows the system to compensate processing latency."]
24063 pub time_boot_ms: u32,
24064 #[doc = "Latitude in WGS84 frame"]
24065 pub lat_int: i32,
24066 #[doc = "Longitude in WGS84 frame"]
24067 pub lon_int: i32,
24068 #[doc = "Altitude (MSL, AGL or relative to home altitude, depending on frame)"]
24069 pub alt: f32,
24070 #[doc = "X velocity in NED frame"]
24071 pub vx: f32,
24072 #[doc = "Y velocity in NED frame"]
24073 pub vy: f32,
24074 #[doc = "Z velocity in NED frame"]
24075 pub vz: f32,
24076 #[doc = "X acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N"]
24077 pub afx: f32,
24078 #[doc = "Y acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N"]
24079 pub afy: f32,
24080 #[doc = "Z acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N"]
24081 pub afz: f32,
24082 #[doc = "yaw setpoint"]
24083 pub yaw: f32,
24084 #[doc = "yaw rate setpoint"]
24085 pub yaw_rate: f32,
24086 #[doc = "Bitmap to indicate which dimensions should be ignored by the vehicle."]
24087 pub type_mask: PositionTargetTypemask,
24088 #[doc = "Valid options are: MAV_FRAME_GLOBAL = 0, MAV_FRAME_GLOBAL_RELATIVE_ALT = 3, MAV_FRAME_GLOBAL_TERRAIN_ALT = 10 (MAV_FRAME_GLOBAL_INT, MAV_FRAME_GLOBAL_RELATIVE_ALT_INT, MAV_FRAME_GLOBAL_TERRAIN_ALT_INT are allowed synonyms, but have been deprecated)"]
24089 pub coordinate_frame: MavFrame,
24090}
24091impl POSITION_TARGET_GLOBAL_INT_DATA {
24092 pub const ENCODED_LEN: usize = 51usize;
24093 pub const DEFAULT: Self = Self {
24094 time_boot_ms: 0_u32,
24095 lat_int: 0_i32,
24096 lon_int: 0_i32,
24097 alt: 0.0_f32,
24098 vx: 0.0_f32,
24099 vy: 0.0_f32,
24100 vz: 0.0_f32,
24101 afx: 0.0_f32,
24102 afy: 0.0_f32,
24103 afz: 0.0_f32,
24104 yaw: 0.0_f32,
24105 yaw_rate: 0.0_f32,
24106 type_mask: PositionTargetTypemask::DEFAULT,
24107 coordinate_frame: MavFrame::DEFAULT,
24108 };
24109 #[cfg(feature = "arbitrary")]
24110 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
24111 use arbitrary::{Arbitrary, Unstructured};
24112 let mut buf = [0u8; 1024];
24113 rng.fill_bytes(&mut buf);
24114 let mut unstructured = Unstructured::new(&buf);
24115 Self::arbitrary(&mut unstructured).unwrap_or_default()
24116 }
24117}
24118impl Default for POSITION_TARGET_GLOBAL_INT_DATA {
24119 fn default() -> Self {
24120 Self::DEFAULT.clone()
24121 }
24122}
24123impl MessageData for POSITION_TARGET_GLOBAL_INT_DATA {
24124 type Message = MavMessage;
24125 const ID: u32 = 87u32;
24126 const NAME: &'static str = "POSITION_TARGET_GLOBAL_INT";
24127 const EXTRA_CRC: u8 = 150u8;
24128 const ENCODED_LEN: usize = 51usize;
24129 fn deser(
24130 _version: MavlinkVersion,
24131 __input: &[u8],
24132 ) -> Result<Self, ::mavlink_core::error::ParserError> {
24133 let avail_len = __input.len();
24134 let mut payload_buf = [0; Self::ENCODED_LEN];
24135 let mut buf = if avail_len < Self::ENCODED_LEN {
24136 payload_buf[0..avail_len].copy_from_slice(__input);
24137 Bytes::new(&payload_buf)
24138 } else {
24139 Bytes::new(__input)
24140 };
24141 let mut __struct = Self::default();
24142 __struct.time_boot_ms = buf.get_u32_le();
24143 __struct.lat_int = buf.get_i32_le();
24144 __struct.lon_int = buf.get_i32_le();
24145 __struct.alt = buf.get_f32_le();
24146 __struct.vx = buf.get_f32_le();
24147 __struct.vy = buf.get_f32_le();
24148 __struct.vz = buf.get_f32_le();
24149 __struct.afx = buf.get_f32_le();
24150 __struct.afy = buf.get_f32_le();
24151 __struct.afz = buf.get_f32_le();
24152 __struct.yaw = buf.get_f32_le();
24153 __struct.yaw_rate = buf.get_f32_le();
24154 let tmp = buf.get_u16_le();
24155 __struct.type_mask = PositionTargetTypemask::from_bits(
24156 tmp & PositionTargetTypemask::all().bits(),
24157 )
24158 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
24159 flag_type: "PositionTargetTypemask",
24160 value: tmp as u32,
24161 })?;
24162 let tmp = buf.get_u8();
24163 __struct.coordinate_frame =
24164 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
24165 enum_type: "MavFrame",
24166 value: tmp as u32,
24167 })?;
24168 Ok(__struct)
24169 }
24170 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
24171 let mut __tmp = BytesMut::new(bytes);
24172 #[allow(clippy::absurd_extreme_comparisons)]
24173 #[allow(unused_comparisons)]
24174 if __tmp.remaining() < Self::ENCODED_LEN {
24175 panic!(
24176 "buffer is too small (need {} bytes, but got {})",
24177 Self::ENCODED_LEN,
24178 __tmp.remaining(),
24179 )
24180 }
24181 __tmp.put_u32_le(self.time_boot_ms);
24182 __tmp.put_i32_le(self.lat_int);
24183 __tmp.put_i32_le(self.lon_int);
24184 __tmp.put_f32_le(self.alt);
24185 __tmp.put_f32_le(self.vx);
24186 __tmp.put_f32_le(self.vy);
24187 __tmp.put_f32_le(self.vz);
24188 __tmp.put_f32_le(self.afx);
24189 __tmp.put_f32_le(self.afy);
24190 __tmp.put_f32_le(self.afz);
24191 __tmp.put_f32_le(self.yaw);
24192 __tmp.put_f32_le(self.yaw_rate);
24193 __tmp.put_u16_le(self.type_mask.bits());
24194 __tmp.put_u8(self.coordinate_frame as u8);
24195 if matches!(version, MavlinkVersion::V2) {
24196 let len = __tmp.len();
24197 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
24198 } else {
24199 __tmp.len()
24200 }
24201 }
24202}
24203#[doc = "Reports the current commanded vehicle position, velocity, and acceleration as specified by the autopilot. This should match the commands sent in SET_POSITION_TARGET_LOCAL_NED if the vehicle is being controlled this way."]
24204#[doc = ""]
24205#[doc = "ID: 85"]
24206#[derive(Debug, Clone, PartialEq)]
24207#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
24208#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
24209pub struct POSITION_TARGET_LOCAL_NED_DATA {
24210 #[doc = "Timestamp (time since system boot)."]
24211 pub time_boot_ms: u32,
24212 #[doc = "X Position in NED frame"]
24213 pub x: f32,
24214 #[doc = "Y Position in NED frame"]
24215 pub y: f32,
24216 #[doc = "Z Position in NED frame (note, altitude is negative in NED)"]
24217 pub z: f32,
24218 #[doc = "X velocity in NED frame"]
24219 pub vx: f32,
24220 #[doc = "Y velocity in NED frame"]
24221 pub vy: f32,
24222 #[doc = "Z velocity in NED frame"]
24223 pub vz: f32,
24224 #[doc = "X acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N"]
24225 pub afx: f32,
24226 #[doc = "Y acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N"]
24227 pub afy: f32,
24228 #[doc = "Z acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N"]
24229 pub afz: f32,
24230 #[doc = "yaw setpoint"]
24231 pub yaw: f32,
24232 #[doc = "yaw rate setpoint"]
24233 pub yaw_rate: f32,
24234 #[doc = "Bitmap to indicate which dimensions should be ignored by the vehicle."]
24235 pub type_mask: PositionTargetTypemask,
24236 #[doc = "Valid options are: MAV_FRAME_LOCAL_NED = 1, MAV_FRAME_LOCAL_OFFSET_NED = 7, MAV_FRAME_BODY_NED = 8, MAV_FRAME_BODY_OFFSET_NED = 9"]
24237 pub coordinate_frame: MavFrame,
24238}
24239impl POSITION_TARGET_LOCAL_NED_DATA {
24240 pub const ENCODED_LEN: usize = 51usize;
24241 pub const DEFAULT: Self = Self {
24242 time_boot_ms: 0_u32,
24243 x: 0.0_f32,
24244 y: 0.0_f32,
24245 z: 0.0_f32,
24246 vx: 0.0_f32,
24247 vy: 0.0_f32,
24248 vz: 0.0_f32,
24249 afx: 0.0_f32,
24250 afy: 0.0_f32,
24251 afz: 0.0_f32,
24252 yaw: 0.0_f32,
24253 yaw_rate: 0.0_f32,
24254 type_mask: PositionTargetTypemask::DEFAULT,
24255 coordinate_frame: MavFrame::DEFAULT,
24256 };
24257 #[cfg(feature = "arbitrary")]
24258 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
24259 use arbitrary::{Arbitrary, Unstructured};
24260 let mut buf = [0u8; 1024];
24261 rng.fill_bytes(&mut buf);
24262 let mut unstructured = Unstructured::new(&buf);
24263 Self::arbitrary(&mut unstructured).unwrap_or_default()
24264 }
24265}
24266impl Default for POSITION_TARGET_LOCAL_NED_DATA {
24267 fn default() -> Self {
24268 Self::DEFAULT.clone()
24269 }
24270}
24271impl MessageData for POSITION_TARGET_LOCAL_NED_DATA {
24272 type Message = MavMessage;
24273 const ID: u32 = 85u32;
24274 const NAME: &'static str = "POSITION_TARGET_LOCAL_NED";
24275 const EXTRA_CRC: u8 = 140u8;
24276 const ENCODED_LEN: usize = 51usize;
24277 fn deser(
24278 _version: MavlinkVersion,
24279 __input: &[u8],
24280 ) -> Result<Self, ::mavlink_core::error::ParserError> {
24281 let avail_len = __input.len();
24282 let mut payload_buf = [0; Self::ENCODED_LEN];
24283 let mut buf = if avail_len < Self::ENCODED_LEN {
24284 payload_buf[0..avail_len].copy_from_slice(__input);
24285 Bytes::new(&payload_buf)
24286 } else {
24287 Bytes::new(__input)
24288 };
24289 let mut __struct = Self::default();
24290 __struct.time_boot_ms = buf.get_u32_le();
24291 __struct.x = buf.get_f32_le();
24292 __struct.y = buf.get_f32_le();
24293 __struct.z = buf.get_f32_le();
24294 __struct.vx = buf.get_f32_le();
24295 __struct.vy = buf.get_f32_le();
24296 __struct.vz = buf.get_f32_le();
24297 __struct.afx = buf.get_f32_le();
24298 __struct.afy = buf.get_f32_le();
24299 __struct.afz = buf.get_f32_le();
24300 __struct.yaw = buf.get_f32_le();
24301 __struct.yaw_rate = buf.get_f32_le();
24302 let tmp = buf.get_u16_le();
24303 __struct.type_mask = PositionTargetTypemask::from_bits(
24304 tmp & PositionTargetTypemask::all().bits(),
24305 )
24306 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
24307 flag_type: "PositionTargetTypemask",
24308 value: tmp as u32,
24309 })?;
24310 let tmp = buf.get_u8();
24311 __struct.coordinate_frame =
24312 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
24313 enum_type: "MavFrame",
24314 value: tmp as u32,
24315 })?;
24316 Ok(__struct)
24317 }
24318 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
24319 let mut __tmp = BytesMut::new(bytes);
24320 #[allow(clippy::absurd_extreme_comparisons)]
24321 #[allow(unused_comparisons)]
24322 if __tmp.remaining() < Self::ENCODED_LEN {
24323 panic!(
24324 "buffer is too small (need {} bytes, but got {})",
24325 Self::ENCODED_LEN,
24326 __tmp.remaining(),
24327 )
24328 }
24329 __tmp.put_u32_le(self.time_boot_ms);
24330 __tmp.put_f32_le(self.x);
24331 __tmp.put_f32_le(self.y);
24332 __tmp.put_f32_le(self.z);
24333 __tmp.put_f32_le(self.vx);
24334 __tmp.put_f32_le(self.vy);
24335 __tmp.put_f32_le(self.vz);
24336 __tmp.put_f32_le(self.afx);
24337 __tmp.put_f32_le(self.afy);
24338 __tmp.put_f32_le(self.afz);
24339 __tmp.put_f32_le(self.yaw);
24340 __tmp.put_f32_le(self.yaw_rate);
24341 __tmp.put_u16_le(self.type_mask.bits());
24342 __tmp.put_u8(self.coordinate_frame as u8);
24343 if matches!(version, MavlinkVersion::V2) {
24344 let len = __tmp.len();
24345 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
24346 } else {
24347 __tmp.len()
24348 }
24349 }
24350}
24351#[doc = "Power supply status."]
24352#[doc = ""]
24353#[doc = "ID: 125"]
24354#[derive(Debug, Clone, PartialEq)]
24355#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
24356#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
24357pub struct POWER_STATUS_DATA {
24358 #[doc = "5V rail voltage."]
24359 pub Vcc: u16,
24360 #[doc = "Servo rail voltage."]
24361 pub Vservo: u16,
24362 #[doc = "Bitmap of power supply status flags."]
24363 pub flags: MavPowerStatus,
24364}
24365impl POWER_STATUS_DATA {
24366 pub const ENCODED_LEN: usize = 6usize;
24367 pub const DEFAULT: Self = Self {
24368 Vcc: 0_u16,
24369 Vservo: 0_u16,
24370 flags: MavPowerStatus::DEFAULT,
24371 };
24372 #[cfg(feature = "arbitrary")]
24373 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
24374 use arbitrary::{Arbitrary, Unstructured};
24375 let mut buf = [0u8; 1024];
24376 rng.fill_bytes(&mut buf);
24377 let mut unstructured = Unstructured::new(&buf);
24378 Self::arbitrary(&mut unstructured).unwrap_or_default()
24379 }
24380}
24381impl Default for POWER_STATUS_DATA {
24382 fn default() -> Self {
24383 Self::DEFAULT.clone()
24384 }
24385}
24386impl MessageData for POWER_STATUS_DATA {
24387 type Message = MavMessage;
24388 const ID: u32 = 125u32;
24389 const NAME: &'static str = "POWER_STATUS";
24390 const EXTRA_CRC: u8 = 203u8;
24391 const ENCODED_LEN: usize = 6usize;
24392 fn deser(
24393 _version: MavlinkVersion,
24394 __input: &[u8],
24395 ) -> Result<Self, ::mavlink_core::error::ParserError> {
24396 let avail_len = __input.len();
24397 let mut payload_buf = [0; Self::ENCODED_LEN];
24398 let mut buf = if avail_len < Self::ENCODED_LEN {
24399 payload_buf[0..avail_len].copy_from_slice(__input);
24400 Bytes::new(&payload_buf)
24401 } else {
24402 Bytes::new(__input)
24403 };
24404 let mut __struct = Self::default();
24405 __struct.Vcc = buf.get_u16_le();
24406 __struct.Vservo = buf.get_u16_le();
24407 let tmp = buf.get_u16_le();
24408 __struct.flags = MavPowerStatus::from_bits(tmp & MavPowerStatus::all().bits()).ok_or(
24409 ::mavlink_core::error::ParserError::InvalidFlag {
24410 flag_type: "MavPowerStatus",
24411 value: tmp as u32,
24412 },
24413 )?;
24414 Ok(__struct)
24415 }
24416 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
24417 let mut __tmp = BytesMut::new(bytes);
24418 #[allow(clippy::absurd_extreme_comparisons)]
24419 #[allow(unused_comparisons)]
24420 if __tmp.remaining() < Self::ENCODED_LEN {
24421 panic!(
24422 "buffer is too small (need {} bytes, but got {})",
24423 Self::ENCODED_LEN,
24424 __tmp.remaining(),
24425 )
24426 }
24427 __tmp.put_u16_le(self.Vcc);
24428 __tmp.put_u16_le(self.Vservo);
24429 __tmp.put_u16_le(self.flags.bits());
24430 if matches!(version, MavlinkVersion::V2) {
24431 let len = __tmp.len();
24432 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
24433 } else {
24434 __tmp.len()
24435 }
24436 }
24437}
24438#[doc = "Version and capability of protocol version. This message can be requested with MAV_CMD_REQUEST_MESSAGE and is used as part of the handshaking to establish which MAVLink version should be used on the network. Every node should respond to a request for PROTOCOL_VERSION to enable the handshaking. Library implementers should consider adding this into the default decoding state machine to allow the protocol core to respond directly."]
24439#[doc = ""]
24440#[doc = "ID: 300"]
24441#[derive(Debug, Clone, PartialEq)]
24442#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
24443#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
24444pub struct PROTOCOL_VERSION_DATA {
24445 #[doc = "Currently active MAVLink version number * 100: v1.0 is 100, v2.0 is 200, etc."]
24446 pub version: u16,
24447 #[doc = "Minimum MAVLink version supported"]
24448 pub min_version: u16,
24449 #[doc = "Maximum MAVLink version supported (set to the same value as version by default)"]
24450 pub max_version: u16,
24451 #[doc = "The first 8 bytes (not characters printed in hex!) of the git hash."]
24452 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
24453 pub spec_version_hash: [u8; 8],
24454 #[doc = "The first 8 bytes (not characters printed in hex!) of the git hash."]
24455 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
24456 pub library_version_hash: [u8; 8],
24457}
24458impl PROTOCOL_VERSION_DATA {
24459 pub const ENCODED_LEN: usize = 22usize;
24460 pub const DEFAULT: Self = Self {
24461 version: 0_u16,
24462 min_version: 0_u16,
24463 max_version: 0_u16,
24464 spec_version_hash: [0_u8; 8usize],
24465 library_version_hash: [0_u8; 8usize],
24466 };
24467 #[cfg(feature = "arbitrary")]
24468 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
24469 use arbitrary::{Arbitrary, Unstructured};
24470 let mut buf = [0u8; 1024];
24471 rng.fill_bytes(&mut buf);
24472 let mut unstructured = Unstructured::new(&buf);
24473 Self::arbitrary(&mut unstructured).unwrap_or_default()
24474 }
24475}
24476impl Default for PROTOCOL_VERSION_DATA {
24477 fn default() -> Self {
24478 Self::DEFAULT.clone()
24479 }
24480}
24481impl MessageData for PROTOCOL_VERSION_DATA {
24482 type Message = MavMessage;
24483 const ID: u32 = 300u32;
24484 const NAME: &'static str = "PROTOCOL_VERSION";
24485 const EXTRA_CRC: u8 = 217u8;
24486 const ENCODED_LEN: usize = 22usize;
24487 fn deser(
24488 _version: MavlinkVersion,
24489 __input: &[u8],
24490 ) -> Result<Self, ::mavlink_core::error::ParserError> {
24491 let avail_len = __input.len();
24492 let mut payload_buf = [0; Self::ENCODED_LEN];
24493 let mut buf = if avail_len < Self::ENCODED_LEN {
24494 payload_buf[0..avail_len].copy_from_slice(__input);
24495 Bytes::new(&payload_buf)
24496 } else {
24497 Bytes::new(__input)
24498 };
24499 let mut __struct = Self::default();
24500 __struct.version = buf.get_u16_le();
24501 __struct.min_version = buf.get_u16_le();
24502 __struct.max_version = buf.get_u16_le();
24503 for v in &mut __struct.spec_version_hash {
24504 let val = buf.get_u8();
24505 *v = val;
24506 }
24507 for v in &mut __struct.library_version_hash {
24508 let val = buf.get_u8();
24509 *v = val;
24510 }
24511 Ok(__struct)
24512 }
24513 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
24514 let mut __tmp = BytesMut::new(bytes);
24515 #[allow(clippy::absurd_extreme_comparisons)]
24516 #[allow(unused_comparisons)]
24517 if __tmp.remaining() < Self::ENCODED_LEN {
24518 panic!(
24519 "buffer is too small (need {} bytes, but got {})",
24520 Self::ENCODED_LEN,
24521 __tmp.remaining(),
24522 )
24523 }
24524 __tmp.put_u16_le(self.version);
24525 __tmp.put_u16_le(self.min_version);
24526 __tmp.put_u16_le(self.max_version);
24527 for val in &self.spec_version_hash {
24528 __tmp.put_u8(*val);
24529 }
24530 for val in &self.library_version_hash {
24531 __tmp.put_u8(*val);
24532 }
24533 if matches!(version, MavlinkVersion::V2) {
24534 let len = __tmp.len();
24535 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
24536 } else {
24537 __tmp.len()
24538 }
24539 }
24540}
24541#[doc = "Status generated by radio and injected into MAVLink stream."]
24542#[doc = ""]
24543#[doc = "ID: 109"]
24544#[derive(Debug, Clone, PartialEq)]
24545#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
24546#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
24547pub struct RADIO_STATUS_DATA {
24548 #[doc = "Count of radio packet receive errors (since boot)."]
24549 pub rxerrors: u16,
24550 #[doc = "Count of error corrected radio packets (since boot)."]
24551 pub fixed: u16,
24552 #[doc = "Local (message sender) received signal strength indication in device-dependent units/scale. Values: [0-254], UINT8_MAX: invalid/unknown."]
24553 pub rssi: u8,
24554 #[doc = "Remote (message receiver) signal strength indication in device-dependent units/scale. Values: [0-254], UINT8_MAX: invalid/unknown."]
24555 pub remrssi: u8,
24556 #[doc = "Remaining free transmitter buffer space."]
24557 pub txbuf: u8,
24558 #[doc = "Local background noise level. These are device dependent RSSI values (scale as approx 2x dB on SiK radios). Values: [0-254], UINT8_MAX: invalid/unknown."]
24559 pub noise: u8,
24560 #[doc = "Remote background noise level. These are device dependent RSSI values (scale as approx 2x dB on SiK radios). Values: [0-254], UINT8_MAX: invalid/unknown."]
24561 pub remnoise: u8,
24562}
24563impl RADIO_STATUS_DATA {
24564 pub const ENCODED_LEN: usize = 9usize;
24565 pub const DEFAULT: Self = Self {
24566 rxerrors: 0_u16,
24567 fixed: 0_u16,
24568 rssi: 0_u8,
24569 remrssi: 0_u8,
24570 txbuf: 0_u8,
24571 noise: 0_u8,
24572 remnoise: 0_u8,
24573 };
24574 #[cfg(feature = "arbitrary")]
24575 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
24576 use arbitrary::{Arbitrary, Unstructured};
24577 let mut buf = [0u8; 1024];
24578 rng.fill_bytes(&mut buf);
24579 let mut unstructured = Unstructured::new(&buf);
24580 Self::arbitrary(&mut unstructured).unwrap_or_default()
24581 }
24582}
24583impl Default for RADIO_STATUS_DATA {
24584 fn default() -> Self {
24585 Self::DEFAULT.clone()
24586 }
24587}
24588impl MessageData for RADIO_STATUS_DATA {
24589 type Message = MavMessage;
24590 const ID: u32 = 109u32;
24591 const NAME: &'static str = "RADIO_STATUS";
24592 const EXTRA_CRC: u8 = 185u8;
24593 const ENCODED_LEN: usize = 9usize;
24594 fn deser(
24595 _version: MavlinkVersion,
24596 __input: &[u8],
24597 ) -> Result<Self, ::mavlink_core::error::ParserError> {
24598 let avail_len = __input.len();
24599 let mut payload_buf = [0; Self::ENCODED_LEN];
24600 let mut buf = if avail_len < Self::ENCODED_LEN {
24601 payload_buf[0..avail_len].copy_from_slice(__input);
24602 Bytes::new(&payload_buf)
24603 } else {
24604 Bytes::new(__input)
24605 };
24606 let mut __struct = Self::default();
24607 __struct.rxerrors = buf.get_u16_le();
24608 __struct.fixed = buf.get_u16_le();
24609 __struct.rssi = buf.get_u8();
24610 __struct.remrssi = buf.get_u8();
24611 __struct.txbuf = buf.get_u8();
24612 __struct.noise = buf.get_u8();
24613 __struct.remnoise = buf.get_u8();
24614 Ok(__struct)
24615 }
24616 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
24617 let mut __tmp = BytesMut::new(bytes);
24618 #[allow(clippy::absurd_extreme_comparisons)]
24619 #[allow(unused_comparisons)]
24620 if __tmp.remaining() < Self::ENCODED_LEN {
24621 panic!(
24622 "buffer is too small (need {} bytes, but got {})",
24623 Self::ENCODED_LEN,
24624 __tmp.remaining(),
24625 )
24626 }
24627 __tmp.put_u16_le(self.rxerrors);
24628 __tmp.put_u16_le(self.fixed);
24629 __tmp.put_u8(self.rssi);
24630 __tmp.put_u8(self.remrssi);
24631 __tmp.put_u8(self.txbuf);
24632 __tmp.put_u8(self.noise);
24633 __tmp.put_u8(self.remnoise);
24634 if matches!(version, MavlinkVersion::V2) {
24635 let len = __tmp.len();
24636 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
24637 } else {
24638 __tmp.len()
24639 }
24640 }
24641}
24642#[doc = "The RAW IMU readings for a 9DOF sensor, which is identified by the id (default IMU1). This message should always contain the true raw values without any scaling to allow data capture and system debugging."]
24643#[doc = ""]
24644#[doc = "ID: 27"]
24645#[derive(Debug, Clone, PartialEq)]
24646#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
24647#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
24648pub struct RAW_IMU_DATA {
24649 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
24650 pub time_usec: u64,
24651 #[doc = "X acceleration (raw)"]
24652 pub xacc: i16,
24653 #[doc = "Y acceleration (raw)"]
24654 pub yacc: i16,
24655 #[doc = "Z acceleration (raw)"]
24656 pub zacc: i16,
24657 #[doc = "Angular speed around X axis (raw)"]
24658 pub xgyro: i16,
24659 #[doc = "Angular speed around Y axis (raw)"]
24660 pub ygyro: i16,
24661 #[doc = "Angular speed around Z axis (raw)"]
24662 pub zgyro: i16,
24663 #[doc = "X Magnetic field (raw)"]
24664 pub xmag: i16,
24665 #[doc = "Y Magnetic field (raw)"]
24666 pub ymag: i16,
24667 #[doc = "Z Magnetic field (raw)"]
24668 pub zmag: i16,
24669 #[doc = "Id. Ids are numbered from 0 and map to IMUs numbered from 1 (e.g. IMU1 will have a message with id=0)"]
24670 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
24671 pub id: u8,
24672 #[doc = "Temperature, 0: IMU does not provide temperature values. If the IMU is at 0C it must send 1 (0.01C)."]
24673 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
24674 pub temperature: i16,
24675}
24676impl RAW_IMU_DATA {
24677 pub const ENCODED_LEN: usize = 29usize;
24678 pub const DEFAULT: Self = Self {
24679 time_usec: 0_u64,
24680 xacc: 0_i16,
24681 yacc: 0_i16,
24682 zacc: 0_i16,
24683 xgyro: 0_i16,
24684 ygyro: 0_i16,
24685 zgyro: 0_i16,
24686 xmag: 0_i16,
24687 ymag: 0_i16,
24688 zmag: 0_i16,
24689 id: 0_u8,
24690 temperature: 0_i16,
24691 };
24692 #[cfg(feature = "arbitrary")]
24693 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
24694 use arbitrary::{Arbitrary, Unstructured};
24695 let mut buf = [0u8; 1024];
24696 rng.fill_bytes(&mut buf);
24697 let mut unstructured = Unstructured::new(&buf);
24698 Self::arbitrary(&mut unstructured).unwrap_or_default()
24699 }
24700}
24701impl Default for RAW_IMU_DATA {
24702 fn default() -> Self {
24703 Self::DEFAULT.clone()
24704 }
24705}
24706impl MessageData for RAW_IMU_DATA {
24707 type Message = MavMessage;
24708 const ID: u32 = 27u32;
24709 const NAME: &'static str = "RAW_IMU";
24710 const EXTRA_CRC: u8 = 144u8;
24711 const ENCODED_LEN: usize = 29usize;
24712 fn deser(
24713 _version: MavlinkVersion,
24714 __input: &[u8],
24715 ) -> Result<Self, ::mavlink_core::error::ParserError> {
24716 let avail_len = __input.len();
24717 let mut payload_buf = [0; Self::ENCODED_LEN];
24718 let mut buf = if avail_len < Self::ENCODED_LEN {
24719 payload_buf[0..avail_len].copy_from_slice(__input);
24720 Bytes::new(&payload_buf)
24721 } else {
24722 Bytes::new(__input)
24723 };
24724 let mut __struct = Self::default();
24725 __struct.time_usec = buf.get_u64_le();
24726 __struct.xacc = buf.get_i16_le();
24727 __struct.yacc = buf.get_i16_le();
24728 __struct.zacc = buf.get_i16_le();
24729 __struct.xgyro = buf.get_i16_le();
24730 __struct.ygyro = buf.get_i16_le();
24731 __struct.zgyro = buf.get_i16_le();
24732 __struct.xmag = buf.get_i16_le();
24733 __struct.ymag = buf.get_i16_le();
24734 __struct.zmag = buf.get_i16_le();
24735 __struct.id = buf.get_u8();
24736 __struct.temperature = buf.get_i16_le();
24737 Ok(__struct)
24738 }
24739 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
24740 let mut __tmp = BytesMut::new(bytes);
24741 #[allow(clippy::absurd_extreme_comparisons)]
24742 #[allow(unused_comparisons)]
24743 if __tmp.remaining() < Self::ENCODED_LEN {
24744 panic!(
24745 "buffer is too small (need {} bytes, but got {})",
24746 Self::ENCODED_LEN,
24747 __tmp.remaining(),
24748 )
24749 }
24750 __tmp.put_u64_le(self.time_usec);
24751 __tmp.put_i16_le(self.xacc);
24752 __tmp.put_i16_le(self.yacc);
24753 __tmp.put_i16_le(self.zacc);
24754 __tmp.put_i16_le(self.xgyro);
24755 __tmp.put_i16_le(self.ygyro);
24756 __tmp.put_i16_le(self.zgyro);
24757 __tmp.put_i16_le(self.xmag);
24758 __tmp.put_i16_le(self.ymag);
24759 __tmp.put_i16_le(self.zmag);
24760 if matches!(version, MavlinkVersion::V2) {
24761 __tmp.put_u8(self.id);
24762 __tmp.put_i16_le(self.temperature);
24763 let len = __tmp.len();
24764 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
24765 } else {
24766 __tmp.len()
24767 }
24768 }
24769}
24770#[doc = "The RAW pressure readings for the typical setup of one absolute pressure and one differential pressure sensor. The sensor values should be the raw, UNSCALED ADC values."]
24771#[doc = ""]
24772#[doc = "ID: 28"]
24773#[derive(Debug, Clone, PartialEq)]
24774#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
24775#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
24776pub struct RAW_PRESSURE_DATA {
24777 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
24778 pub time_usec: u64,
24779 #[doc = "Absolute pressure (raw)"]
24780 pub press_abs: i16,
24781 #[doc = "Differential pressure 1 (raw, 0 if nonexistent)"]
24782 pub press_diff1: i16,
24783 #[doc = "Differential pressure 2 (raw, 0 if nonexistent)"]
24784 pub press_diff2: i16,
24785 #[doc = "Raw Temperature measurement (raw)"]
24786 pub temperature: i16,
24787}
24788impl RAW_PRESSURE_DATA {
24789 pub const ENCODED_LEN: usize = 16usize;
24790 pub const DEFAULT: Self = Self {
24791 time_usec: 0_u64,
24792 press_abs: 0_i16,
24793 press_diff1: 0_i16,
24794 press_diff2: 0_i16,
24795 temperature: 0_i16,
24796 };
24797 #[cfg(feature = "arbitrary")]
24798 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
24799 use arbitrary::{Arbitrary, Unstructured};
24800 let mut buf = [0u8; 1024];
24801 rng.fill_bytes(&mut buf);
24802 let mut unstructured = Unstructured::new(&buf);
24803 Self::arbitrary(&mut unstructured).unwrap_or_default()
24804 }
24805}
24806impl Default for RAW_PRESSURE_DATA {
24807 fn default() -> Self {
24808 Self::DEFAULT.clone()
24809 }
24810}
24811impl MessageData for RAW_PRESSURE_DATA {
24812 type Message = MavMessage;
24813 const ID: u32 = 28u32;
24814 const NAME: &'static str = "RAW_PRESSURE";
24815 const EXTRA_CRC: u8 = 67u8;
24816 const ENCODED_LEN: usize = 16usize;
24817 fn deser(
24818 _version: MavlinkVersion,
24819 __input: &[u8],
24820 ) -> Result<Self, ::mavlink_core::error::ParserError> {
24821 let avail_len = __input.len();
24822 let mut payload_buf = [0; Self::ENCODED_LEN];
24823 let mut buf = if avail_len < Self::ENCODED_LEN {
24824 payload_buf[0..avail_len].copy_from_slice(__input);
24825 Bytes::new(&payload_buf)
24826 } else {
24827 Bytes::new(__input)
24828 };
24829 let mut __struct = Self::default();
24830 __struct.time_usec = buf.get_u64_le();
24831 __struct.press_abs = buf.get_i16_le();
24832 __struct.press_diff1 = buf.get_i16_le();
24833 __struct.press_diff2 = buf.get_i16_le();
24834 __struct.temperature = buf.get_i16_le();
24835 Ok(__struct)
24836 }
24837 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
24838 let mut __tmp = BytesMut::new(bytes);
24839 #[allow(clippy::absurd_extreme_comparisons)]
24840 #[allow(unused_comparisons)]
24841 if __tmp.remaining() < Self::ENCODED_LEN {
24842 panic!(
24843 "buffer is too small (need {} bytes, but got {})",
24844 Self::ENCODED_LEN,
24845 __tmp.remaining(),
24846 )
24847 }
24848 __tmp.put_u64_le(self.time_usec);
24849 __tmp.put_i16_le(self.press_abs);
24850 __tmp.put_i16_le(self.press_diff1);
24851 __tmp.put_i16_le(self.press_diff2);
24852 __tmp.put_i16_le(self.temperature);
24853 if matches!(version, MavlinkVersion::V2) {
24854 let len = __tmp.len();
24855 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
24856 } else {
24857 __tmp.len()
24858 }
24859 }
24860}
24861#[doc = "RPM sensor data message."]
24862#[doc = ""]
24863#[doc = "ID: 339"]
24864#[derive(Debug, Clone, PartialEq)]
24865#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
24866#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
24867pub struct RAW_RPM_DATA {
24868 #[doc = "Indicated rate"]
24869 pub frequency: f32,
24870 #[doc = "Index of this RPM sensor (0-indexed)"]
24871 pub index: u8,
24872}
24873impl RAW_RPM_DATA {
24874 pub const ENCODED_LEN: usize = 5usize;
24875 pub const DEFAULT: Self = Self {
24876 frequency: 0.0_f32,
24877 index: 0_u8,
24878 };
24879 #[cfg(feature = "arbitrary")]
24880 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
24881 use arbitrary::{Arbitrary, Unstructured};
24882 let mut buf = [0u8; 1024];
24883 rng.fill_bytes(&mut buf);
24884 let mut unstructured = Unstructured::new(&buf);
24885 Self::arbitrary(&mut unstructured).unwrap_or_default()
24886 }
24887}
24888impl Default for RAW_RPM_DATA {
24889 fn default() -> Self {
24890 Self::DEFAULT.clone()
24891 }
24892}
24893impl MessageData for RAW_RPM_DATA {
24894 type Message = MavMessage;
24895 const ID: u32 = 339u32;
24896 const NAME: &'static str = "RAW_RPM";
24897 const EXTRA_CRC: u8 = 199u8;
24898 const ENCODED_LEN: usize = 5usize;
24899 fn deser(
24900 _version: MavlinkVersion,
24901 __input: &[u8],
24902 ) -> Result<Self, ::mavlink_core::error::ParserError> {
24903 let avail_len = __input.len();
24904 let mut payload_buf = [0; Self::ENCODED_LEN];
24905 let mut buf = if avail_len < Self::ENCODED_LEN {
24906 payload_buf[0..avail_len].copy_from_slice(__input);
24907 Bytes::new(&payload_buf)
24908 } else {
24909 Bytes::new(__input)
24910 };
24911 let mut __struct = Self::default();
24912 __struct.frequency = buf.get_f32_le();
24913 __struct.index = buf.get_u8();
24914 Ok(__struct)
24915 }
24916 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
24917 let mut __tmp = BytesMut::new(bytes);
24918 #[allow(clippy::absurd_extreme_comparisons)]
24919 #[allow(unused_comparisons)]
24920 if __tmp.remaining() < Self::ENCODED_LEN {
24921 panic!(
24922 "buffer is too small (need {} bytes, but got {})",
24923 Self::ENCODED_LEN,
24924 __tmp.remaining(),
24925 )
24926 }
24927 __tmp.put_f32_le(self.frequency);
24928 __tmp.put_u8(self.index);
24929 if matches!(version, MavlinkVersion::V2) {
24930 let len = __tmp.len();
24931 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
24932 } else {
24933 __tmp.len()
24934 }
24935 }
24936}
24937#[doc = "The PPM values of the RC channels received. The standard PPM modulation is as follows: 1000 microseconds: 0%, 2000 microseconds: 100%. A value of UINT16_MAX implies the channel is unused. Individual receivers/transmitters might violate this specification."]
24938#[doc = ""]
24939#[doc = "ID: 65"]
24940#[derive(Debug, Clone, PartialEq)]
24941#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
24942#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
24943pub struct RC_CHANNELS_DATA {
24944 #[doc = "Timestamp (time since system boot)."]
24945 pub time_boot_ms: u32,
24946 #[doc = "RC channel 1 value."]
24947 pub chan1_raw: u16,
24948 #[doc = "RC channel 2 value."]
24949 pub chan2_raw: u16,
24950 #[doc = "RC channel 3 value."]
24951 pub chan3_raw: u16,
24952 #[doc = "RC channel 4 value."]
24953 pub chan4_raw: u16,
24954 #[doc = "RC channel 5 value."]
24955 pub chan5_raw: u16,
24956 #[doc = "RC channel 6 value."]
24957 pub chan6_raw: u16,
24958 #[doc = "RC channel 7 value."]
24959 pub chan7_raw: u16,
24960 #[doc = "RC channel 8 value."]
24961 pub chan8_raw: u16,
24962 #[doc = "RC channel 9 value."]
24963 pub chan9_raw: u16,
24964 #[doc = "RC channel 10 value."]
24965 pub chan10_raw: u16,
24966 #[doc = "RC channel 11 value."]
24967 pub chan11_raw: u16,
24968 #[doc = "RC channel 12 value."]
24969 pub chan12_raw: u16,
24970 #[doc = "RC channel 13 value."]
24971 pub chan13_raw: u16,
24972 #[doc = "RC channel 14 value."]
24973 pub chan14_raw: u16,
24974 #[doc = "RC channel 15 value."]
24975 pub chan15_raw: u16,
24976 #[doc = "RC channel 16 value."]
24977 pub chan16_raw: u16,
24978 #[doc = "RC channel 17 value."]
24979 pub chan17_raw: u16,
24980 #[doc = "RC channel 18 value."]
24981 pub chan18_raw: u16,
24982 #[doc = "Total number of RC channels being received. This can be larger than 18, indicating that more channels are available but not given in this message. This value should be 0 when no RC channels are available."]
24983 pub chancount: u8,
24984 #[doc = "Receive signal strength indicator in device-dependent units/scale. Values: [0-254], UINT8_MAX: invalid/unknown."]
24985 pub rssi: u8,
24986}
24987impl RC_CHANNELS_DATA {
24988 pub const ENCODED_LEN: usize = 42usize;
24989 pub const DEFAULT: Self = Self {
24990 time_boot_ms: 0_u32,
24991 chan1_raw: 0_u16,
24992 chan2_raw: 0_u16,
24993 chan3_raw: 0_u16,
24994 chan4_raw: 0_u16,
24995 chan5_raw: 0_u16,
24996 chan6_raw: 0_u16,
24997 chan7_raw: 0_u16,
24998 chan8_raw: 0_u16,
24999 chan9_raw: 0_u16,
25000 chan10_raw: 0_u16,
25001 chan11_raw: 0_u16,
25002 chan12_raw: 0_u16,
25003 chan13_raw: 0_u16,
25004 chan14_raw: 0_u16,
25005 chan15_raw: 0_u16,
25006 chan16_raw: 0_u16,
25007 chan17_raw: 0_u16,
25008 chan18_raw: 0_u16,
25009 chancount: 0_u8,
25010 rssi: 0_u8,
25011 };
25012 #[cfg(feature = "arbitrary")]
25013 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
25014 use arbitrary::{Arbitrary, Unstructured};
25015 let mut buf = [0u8; 1024];
25016 rng.fill_bytes(&mut buf);
25017 let mut unstructured = Unstructured::new(&buf);
25018 Self::arbitrary(&mut unstructured).unwrap_or_default()
25019 }
25020}
25021impl Default for RC_CHANNELS_DATA {
25022 fn default() -> Self {
25023 Self::DEFAULT.clone()
25024 }
25025}
25026impl MessageData for RC_CHANNELS_DATA {
25027 type Message = MavMessage;
25028 const ID: u32 = 65u32;
25029 const NAME: &'static str = "RC_CHANNELS";
25030 const EXTRA_CRC: u8 = 118u8;
25031 const ENCODED_LEN: usize = 42usize;
25032 fn deser(
25033 _version: MavlinkVersion,
25034 __input: &[u8],
25035 ) -> Result<Self, ::mavlink_core::error::ParserError> {
25036 let avail_len = __input.len();
25037 let mut payload_buf = [0; Self::ENCODED_LEN];
25038 let mut buf = if avail_len < Self::ENCODED_LEN {
25039 payload_buf[0..avail_len].copy_from_slice(__input);
25040 Bytes::new(&payload_buf)
25041 } else {
25042 Bytes::new(__input)
25043 };
25044 let mut __struct = Self::default();
25045 __struct.time_boot_ms = buf.get_u32_le();
25046 __struct.chan1_raw = buf.get_u16_le();
25047 __struct.chan2_raw = buf.get_u16_le();
25048 __struct.chan3_raw = buf.get_u16_le();
25049 __struct.chan4_raw = buf.get_u16_le();
25050 __struct.chan5_raw = buf.get_u16_le();
25051 __struct.chan6_raw = buf.get_u16_le();
25052 __struct.chan7_raw = buf.get_u16_le();
25053 __struct.chan8_raw = buf.get_u16_le();
25054 __struct.chan9_raw = buf.get_u16_le();
25055 __struct.chan10_raw = buf.get_u16_le();
25056 __struct.chan11_raw = buf.get_u16_le();
25057 __struct.chan12_raw = buf.get_u16_le();
25058 __struct.chan13_raw = buf.get_u16_le();
25059 __struct.chan14_raw = buf.get_u16_le();
25060 __struct.chan15_raw = buf.get_u16_le();
25061 __struct.chan16_raw = buf.get_u16_le();
25062 __struct.chan17_raw = buf.get_u16_le();
25063 __struct.chan18_raw = buf.get_u16_le();
25064 __struct.chancount = buf.get_u8();
25065 __struct.rssi = buf.get_u8();
25066 Ok(__struct)
25067 }
25068 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
25069 let mut __tmp = BytesMut::new(bytes);
25070 #[allow(clippy::absurd_extreme_comparisons)]
25071 #[allow(unused_comparisons)]
25072 if __tmp.remaining() < Self::ENCODED_LEN {
25073 panic!(
25074 "buffer is too small (need {} bytes, but got {})",
25075 Self::ENCODED_LEN,
25076 __tmp.remaining(),
25077 )
25078 }
25079 __tmp.put_u32_le(self.time_boot_ms);
25080 __tmp.put_u16_le(self.chan1_raw);
25081 __tmp.put_u16_le(self.chan2_raw);
25082 __tmp.put_u16_le(self.chan3_raw);
25083 __tmp.put_u16_le(self.chan4_raw);
25084 __tmp.put_u16_le(self.chan5_raw);
25085 __tmp.put_u16_le(self.chan6_raw);
25086 __tmp.put_u16_le(self.chan7_raw);
25087 __tmp.put_u16_le(self.chan8_raw);
25088 __tmp.put_u16_le(self.chan9_raw);
25089 __tmp.put_u16_le(self.chan10_raw);
25090 __tmp.put_u16_le(self.chan11_raw);
25091 __tmp.put_u16_le(self.chan12_raw);
25092 __tmp.put_u16_le(self.chan13_raw);
25093 __tmp.put_u16_le(self.chan14_raw);
25094 __tmp.put_u16_le(self.chan15_raw);
25095 __tmp.put_u16_le(self.chan16_raw);
25096 __tmp.put_u16_le(self.chan17_raw);
25097 __tmp.put_u16_le(self.chan18_raw);
25098 __tmp.put_u8(self.chancount);
25099 __tmp.put_u8(self.rssi);
25100 if matches!(version, MavlinkVersion::V2) {
25101 let len = __tmp.len();
25102 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
25103 } else {
25104 __tmp.len()
25105 }
25106 }
25107}
25108#[doc = "The RAW values of the RC channels sent to the MAV to override info received from the RC radio. The standard PPM modulation is as follows: 1000 microseconds: 0%, 2000 microseconds: 100%. Individual receivers/transmitters might violate this specification. Note carefully the semantic differences between the first 8 channels and the subsequent channels."]
25109#[doc = ""]
25110#[doc = "ID: 70"]
25111#[derive(Debug, Clone, PartialEq)]
25112#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
25113#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
25114pub struct RC_CHANNELS_OVERRIDE_DATA {
25115 #[doc = "RC channel 1 value. A value of UINT16_MAX means to ignore this field. A value of 0 means to release this channel back to the RC radio."]
25116 pub chan1_raw: u16,
25117 #[doc = "RC channel 2 value. A value of UINT16_MAX means to ignore this field. A value of 0 means to release this channel back to the RC radio."]
25118 pub chan2_raw: u16,
25119 #[doc = "RC channel 3 value. A value of UINT16_MAX means to ignore this field. A value of 0 means to release this channel back to the RC radio."]
25120 pub chan3_raw: u16,
25121 #[doc = "RC channel 4 value. A value of UINT16_MAX means to ignore this field. A value of 0 means to release this channel back to the RC radio."]
25122 pub chan4_raw: u16,
25123 #[doc = "RC channel 5 value. A value of UINT16_MAX means to ignore this field. A value of 0 means to release this channel back to the RC radio."]
25124 pub chan5_raw: u16,
25125 #[doc = "RC channel 6 value. A value of UINT16_MAX means to ignore this field. A value of 0 means to release this channel back to the RC radio."]
25126 pub chan6_raw: u16,
25127 #[doc = "RC channel 7 value. A value of UINT16_MAX means to ignore this field. A value of 0 means to release this channel back to the RC radio."]
25128 pub chan7_raw: u16,
25129 #[doc = "RC channel 8 value. A value of UINT16_MAX means to ignore this field. A value of 0 means to release this channel back to the RC radio."]
25130 pub chan8_raw: u16,
25131 #[doc = "System ID"]
25132 pub target_system: u8,
25133 #[doc = "Component ID"]
25134 pub target_component: u8,
25135 #[doc = "RC channel 9 value. A value of 0 or UINT16_MAX means to ignore this field. A value of UINT16_MAX-1 means to release this channel back to the RC radio."]
25136 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
25137 pub chan9_raw: u16,
25138 #[doc = "RC channel 10 value. A value of 0 or UINT16_MAX means to ignore this field. A value of UINT16_MAX-1 means to release this channel back to the RC radio."]
25139 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
25140 pub chan10_raw: u16,
25141 #[doc = "RC channel 11 value. A value of 0 or UINT16_MAX means to ignore this field. A value of UINT16_MAX-1 means to release this channel back to the RC radio."]
25142 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
25143 pub chan11_raw: u16,
25144 #[doc = "RC channel 12 value. A value of 0 or UINT16_MAX means to ignore this field. A value of UINT16_MAX-1 means to release this channel back to the RC radio."]
25145 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
25146 pub chan12_raw: u16,
25147 #[doc = "RC channel 13 value. A value of 0 or UINT16_MAX means to ignore this field. A value of UINT16_MAX-1 means to release this channel back to the RC radio."]
25148 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
25149 pub chan13_raw: u16,
25150 #[doc = "RC channel 14 value. A value of 0 or UINT16_MAX means to ignore this field. A value of UINT16_MAX-1 means to release this channel back to the RC radio."]
25151 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
25152 pub chan14_raw: u16,
25153 #[doc = "RC channel 15 value. A value of 0 or UINT16_MAX means to ignore this field. A value of UINT16_MAX-1 means to release this channel back to the RC radio."]
25154 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
25155 pub chan15_raw: u16,
25156 #[doc = "RC channel 16 value. A value of 0 or UINT16_MAX means to ignore this field. A value of UINT16_MAX-1 means to release this channel back to the RC radio."]
25157 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
25158 pub chan16_raw: u16,
25159 #[doc = "RC channel 17 value. A value of 0 or UINT16_MAX means to ignore this field. A value of UINT16_MAX-1 means to release this channel back to the RC radio."]
25160 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
25161 pub chan17_raw: u16,
25162 #[doc = "RC channel 18 value. A value of 0 or UINT16_MAX means to ignore this field. A value of UINT16_MAX-1 means to release this channel back to the RC radio."]
25163 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
25164 pub chan18_raw: u16,
25165}
25166impl RC_CHANNELS_OVERRIDE_DATA {
25167 pub const ENCODED_LEN: usize = 38usize;
25168 pub const DEFAULT: Self = Self {
25169 chan1_raw: 0_u16,
25170 chan2_raw: 0_u16,
25171 chan3_raw: 0_u16,
25172 chan4_raw: 0_u16,
25173 chan5_raw: 0_u16,
25174 chan6_raw: 0_u16,
25175 chan7_raw: 0_u16,
25176 chan8_raw: 0_u16,
25177 target_system: 0_u8,
25178 target_component: 0_u8,
25179 chan9_raw: 0_u16,
25180 chan10_raw: 0_u16,
25181 chan11_raw: 0_u16,
25182 chan12_raw: 0_u16,
25183 chan13_raw: 0_u16,
25184 chan14_raw: 0_u16,
25185 chan15_raw: 0_u16,
25186 chan16_raw: 0_u16,
25187 chan17_raw: 0_u16,
25188 chan18_raw: 0_u16,
25189 };
25190 #[cfg(feature = "arbitrary")]
25191 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
25192 use arbitrary::{Arbitrary, Unstructured};
25193 let mut buf = [0u8; 1024];
25194 rng.fill_bytes(&mut buf);
25195 let mut unstructured = Unstructured::new(&buf);
25196 Self::arbitrary(&mut unstructured).unwrap_or_default()
25197 }
25198}
25199impl Default for RC_CHANNELS_OVERRIDE_DATA {
25200 fn default() -> Self {
25201 Self::DEFAULT.clone()
25202 }
25203}
25204impl MessageData for RC_CHANNELS_OVERRIDE_DATA {
25205 type Message = MavMessage;
25206 const ID: u32 = 70u32;
25207 const NAME: &'static str = "RC_CHANNELS_OVERRIDE";
25208 const EXTRA_CRC: u8 = 124u8;
25209 const ENCODED_LEN: usize = 38usize;
25210 fn deser(
25211 _version: MavlinkVersion,
25212 __input: &[u8],
25213 ) -> Result<Self, ::mavlink_core::error::ParserError> {
25214 let avail_len = __input.len();
25215 let mut payload_buf = [0; Self::ENCODED_LEN];
25216 let mut buf = if avail_len < Self::ENCODED_LEN {
25217 payload_buf[0..avail_len].copy_from_slice(__input);
25218 Bytes::new(&payload_buf)
25219 } else {
25220 Bytes::new(__input)
25221 };
25222 let mut __struct = Self::default();
25223 __struct.chan1_raw = buf.get_u16_le();
25224 __struct.chan2_raw = buf.get_u16_le();
25225 __struct.chan3_raw = buf.get_u16_le();
25226 __struct.chan4_raw = buf.get_u16_le();
25227 __struct.chan5_raw = buf.get_u16_le();
25228 __struct.chan6_raw = buf.get_u16_le();
25229 __struct.chan7_raw = buf.get_u16_le();
25230 __struct.chan8_raw = buf.get_u16_le();
25231 __struct.target_system = buf.get_u8();
25232 __struct.target_component = buf.get_u8();
25233 __struct.chan9_raw = buf.get_u16_le();
25234 __struct.chan10_raw = buf.get_u16_le();
25235 __struct.chan11_raw = buf.get_u16_le();
25236 __struct.chan12_raw = buf.get_u16_le();
25237 __struct.chan13_raw = buf.get_u16_le();
25238 __struct.chan14_raw = buf.get_u16_le();
25239 __struct.chan15_raw = buf.get_u16_le();
25240 __struct.chan16_raw = buf.get_u16_le();
25241 __struct.chan17_raw = buf.get_u16_le();
25242 __struct.chan18_raw = buf.get_u16_le();
25243 Ok(__struct)
25244 }
25245 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
25246 let mut __tmp = BytesMut::new(bytes);
25247 #[allow(clippy::absurd_extreme_comparisons)]
25248 #[allow(unused_comparisons)]
25249 if __tmp.remaining() < Self::ENCODED_LEN {
25250 panic!(
25251 "buffer is too small (need {} bytes, but got {})",
25252 Self::ENCODED_LEN,
25253 __tmp.remaining(),
25254 )
25255 }
25256 __tmp.put_u16_le(self.chan1_raw);
25257 __tmp.put_u16_le(self.chan2_raw);
25258 __tmp.put_u16_le(self.chan3_raw);
25259 __tmp.put_u16_le(self.chan4_raw);
25260 __tmp.put_u16_le(self.chan5_raw);
25261 __tmp.put_u16_le(self.chan6_raw);
25262 __tmp.put_u16_le(self.chan7_raw);
25263 __tmp.put_u16_le(self.chan8_raw);
25264 __tmp.put_u8(self.target_system);
25265 __tmp.put_u8(self.target_component);
25266 if matches!(version, MavlinkVersion::V2) {
25267 __tmp.put_u16_le(self.chan9_raw);
25268 __tmp.put_u16_le(self.chan10_raw);
25269 __tmp.put_u16_le(self.chan11_raw);
25270 __tmp.put_u16_le(self.chan12_raw);
25271 __tmp.put_u16_le(self.chan13_raw);
25272 __tmp.put_u16_le(self.chan14_raw);
25273 __tmp.put_u16_le(self.chan15_raw);
25274 __tmp.put_u16_le(self.chan16_raw);
25275 __tmp.put_u16_le(self.chan17_raw);
25276 __tmp.put_u16_le(self.chan18_raw);
25277 let len = __tmp.len();
25278 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
25279 } else {
25280 __tmp.len()
25281 }
25282 }
25283}
25284#[doc = "The RAW values of the RC channels received. The standard PPM modulation is as follows: 1000 microseconds: 0%, 2000 microseconds: 100%. A value of UINT16_MAX implies the channel is unused. Individual receivers/transmitters might violate this specification."]
25285#[doc = ""]
25286#[doc = "ID: 35"]
25287#[derive(Debug, Clone, PartialEq)]
25288#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
25289#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
25290pub struct RC_CHANNELS_RAW_DATA {
25291 #[doc = "Timestamp (time since system boot)."]
25292 pub time_boot_ms: u32,
25293 #[doc = "RC channel 1 value."]
25294 pub chan1_raw: u16,
25295 #[doc = "RC channel 2 value."]
25296 pub chan2_raw: u16,
25297 #[doc = "RC channel 3 value."]
25298 pub chan3_raw: u16,
25299 #[doc = "RC channel 4 value."]
25300 pub chan4_raw: u16,
25301 #[doc = "RC channel 5 value."]
25302 pub chan5_raw: u16,
25303 #[doc = "RC channel 6 value."]
25304 pub chan6_raw: u16,
25305 #[doc = "RC channel 7 value."]
25306 pub chan7_raw: u16,
25307 #[doc = "RC channel 8 value."]
25308 pub chan8_raw: u16,
25309 #[doc = "Servo output port (set of 8 outputs = 1 port). Flight stacks running on Pixhawk should use: 0 = MAIN, 1 = AUX."]
25310 pub port: u8,
25311 #[doc = "Receive signal strength indicator in device-dependent units/scale. Values: [0-254], UINT8_MAX: invalid/unknown."]
25312 pub rssi: u8,
25313}
25314impl RC_CHANNELS_RAW_DATA {
25315 pub const ENCODED_LEN: usize = 22usize;
25316 pub const DEFAULT: Self = Self {
25317 time_boot_ms: 0_u32,
25318 chan1_raw: 0_u16,
25319 chan2_raw: 0_u16,
25320 chan3_raw: 0_u16,
25321 chan4_raw: 0_u16,
25322 chan5_raw: 0_u16,
25323 chan6_raw: 0_u16,
25324 chan7_raw: 0_u16,
25325 chan8_raw: 0_u16,
25326 port: 0_u8,
25327 rssi: 0_u8,
25328 };
25329 #[cfg(feature = "arbitrary")]
25330 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
25331 use arbitrary::{Arbitrary, Unstructured};
25332 let mut buf = [0u8; 1024];
25333 rng.fill_bytes(&mut buf);
25334 let mut unstructured = Unstructured::new(&buf);
25335 Self::arbitrary(&mut unstructured).unwrap_or_default()
25336 }
25337}
25338impl Default for RC_CHANNELS_RAW_DATA {
25339 fn default() -> Self {
25340 Self::DEFAULT.clone()
25341 }
25342}
25343impl MessageData for RC_CHANNELS_RAW_DATA {
25344 type Message = MavMessage;
25345 const ID: u32 = 35u32;
25346 const NAME: &'static str = "RC_CHANNELS_RAW";
25347 const EXTRA_CRC: u8 = 244u8;
25348 const ENCODED_LEN: usize = 22usize;
25349 fn deser(
25350 _version: MavlinkVersion,
25351 __input: &[u8],
25352 ) -> Result<Self, ::mavlink_core::error::ParserError> {
25353 let avail_len = __input.len();
25354 let mut payload_buf = [0; Self::ENCODED_LEN];
25355 let mut buf = if avail_len < Self::ENCODED_LEN {
25356 payload_buf[0..avail_len].copy_from_slice(__input);
25357 Bytes::new(&payload_buf)
25358 } else {
25359 Bytes::new(__input)
25360 };
25361 let mut __struct = Self::default();
25362 __struct.time_boot_ms = buf.get_u32_le();
25363 __struct.chan1_raw = buf.get_u16_le();
25364 __struct.chan2_raw = buf.get_u16_le();
25365 __struct.chan3_raw = buf.get_u16_le();
25366 __struct.chan4_raw = buf.get_u16_le();
25367 __struct.chan5_raw = buf.get_u16_le();
25368 __struct.chan6_raw = buf.get_u16_le();
25369 __struct.chan7_raw = buf.get_u16_le();
25370 __struct.chan8_raw = buf.get_u16_le();
25371 __struct.port = buf.get_u8();
25372 __struct.rssi = buf.get_u8();
25373 Ok(__struct)
25374 }
25375 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
25376 let mut __tmp = BytesMut::new(bytes);
25377 #[allow(clippy::absurd_extreme_comparisons)]
25378 #[allow(unused_comparisons)]
25379 if __tmp.remaining() < Self::ENCODED_LEN {
25380 panic!(
25381 "buffer is too small (need {} bytes, but got {})",
25382 Self::ENCODED_LEN,
25383 __tmp.remaining(),
25384 )
25385 }
25386 __tmp.put_u32_le(self.time_boot_ms);
25387 __tmp.put_u16_le(self.chan1_raw);
25388 __tmp.put_u16_le(self.chan2_raw);
25389 __tmp.put_u16_le(self.chan3_raw);
25390 __tmp.put_u16_le(self.chan4_raw);
25391 __tmp.put_u16_le(self.chan5_raw);
25392 __tmp.put_u16_le(self.chan6_raw);
25393 __tmp.put_u16_le(self.chan7_raw);
25394 __tmp.put_u16_le(self.chan8_raw);
25395 __tmp.put_u8(self.port);
25396 __tmp.put_u8(self.rssi);
25397 if matches!(version, MavlinkVersion::V2) {
25398 let len = __tmp.len();
25399 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
25400 } else {
25401 __tmp.len()
25402 }
25403 }
25404}
25405#[doc = "The scaled values of the RC channels received: (-100%) -10000, (0%) 0, (100%) 10000. Channels that are inactive should be set to INT16_MAX."]
25406#[doc = ""]
25407#[doc = "ID: 34"]
25408#[derive(Debug, Clone, PartialEq)]
25409#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
25410#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
25411pub struct RC_CHANNELS_SCALED_DATA {
25412 #[doc = "Timestamp (time since system boot)."]
25413 pub time_boot_ms: u32,
25414 #[doc = "RC channel 1 value scaled."]
25415 pub chan1_scaled: i16,
25416 #[doc = "RC channel 2 value scaled."]
25417 pub chan2_scaled: i16,
25418 #[doc = "RC channel 3 value scaled."]
25419 pub chan3_scaled: i16,
25420 #[doc = "RC channel 4 value scaled."]
25421 pub chan4_scaled: i16,
25422 #[doc = "RC channel 5 value scaled."]
25423 pub chan5_scaled: i16,
25424 #[doc = "RC channel 6 value scaled."]
25425 pub chan6_scaled: i16,
25426 #[doc = "RC channel 7 value scaled."]
25427 pub chan7_scaled: i16,
25428 #[doc = "RC channel 8 value scaled."]
25429 pub chan8_scaled: i16,
25430 #[doc = "Servo output port (set of 8 outputs = 1 port). Flight stacks running on Pixhawk should use: 0 = MAIN, 1 = AUX."]
25431 pub port: u8,
25432 #[doc = "Receive signal strength indicator in device-dependent units/scale. Values: [0-254], UINT8_MAX: invalid/unknown."]
25433 pub rssi: u8,
25434}
25435impl RC_CHANNELS_SCALED_DATA {
25436 pub const ENCODED_LEN: usize = 22usize;
25437 pub const DEFAULT: Self = Self {
25438 time_boot_ms: 0_u32,
25439 chan1_scaled: 0_i16,
25440 chan2_scaled: 0_i16,
25441 chan3_scaled: 0_i16,
25442 chan4_scaled: 0_i16,
25443 chan5_scaled: 0_i16,
25444 chan6_scaled: 0_i16,
25445 chan7_scaled: 0_i16,
25446 chan8_scaled: 0_i16,
25447 port: 0_u8,
25448 rssi: 0_u8,
25449 };
25450 #[cfg(feature = "arbitrary")]
25451 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
25452 use arbitrary::{Arbitrary, Unstructured};
25453 let mut buf = [0u8; 1024];
25454 rng.fill_bytes(&mut buf);
25455 let mut unstructured = Unstructured::new(&buf);
25456 Self::arbitrary(&mut unstructured).unwrap_or_default()
25457 }
25458}
25459impl Default for RC_CHANNELS_SCALED_DATA {
25460 fn default() -> Self {
25461 Self::DEFAULT.clone()
25462 }
25463}
25464impl MessageData for RC_CHANNELS_SCALED_DATA {
25465 type Message = MavMessage;
25466 const ID: u32 = 34u32;
25467 const NAME: &'static str = "RC_CHANNELS_SCALED";
25468 const EXTRA_CRC: u8 = 237u8;
25469 const ENCODED_LEN: usize = 22usize;
25470 fn deser(
25471 _version: MavlinkVersion,
25472 __input: &[u8],
25473 ) -> Result<Self, ::mavlink_core::error::ParserError> {
25474 let avail_len = __input.len();
25475 let mut payload_buf = [0; Self::ENCODED_LEN];
25476 let mut buf = if avail_len < Self::ENCODED_LEN {
25477 payload_buf[0..avail_len].copy_from_slice(__input);
25478 Bytes::new(&payload_buf)
25479 } else {
25480 Bytes::new(__input)
25481 };
25482 let mut __struct = Self::default();
25483 __struct.time_boot_ms = buf.get_u32_le();
25484 __struct.chan1_scaled = buf.get_i16_le();
25485 __struct.chan2_scaled = buf.get_i16_le();
25486 __struct.chan3_scaled = buf.get_i16_le();
25487 __struct.chan4_scaled = buf.get_i16_le();
25488 __struct.chan5_scaled = buf.get_i16_le();
25489 __struct.chan6_scaled = buf.get_i16_le();
25490 __struct.chan7_scaled = buf.get_i16_le();
25491 __struct.chan8_scaled = buf.get_i16_le();
25492 __struct.port = buf.get_u8();
25493 __struct.rssi = buf.get_u8();
25494 Ok(__struct)
25495 }
25496 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
25497 let mut __tmp = BytesMut::new(bytes);
25498 #[allow(clippy::absurd_extreme_comparisons)]
25499 #[allow(unused_comparisons)]
25500 if __tmp.remaining() < Self::ENCODED_LEN {
25501 panic!(
25502 "buffer is too small (need {} bytes, but got {})",
25503 Self::ENCODED_LEN,
25504 __tmp.remaining(),
25505 )
25506 }
25507 __tmp.put_u32_le(self.time_boot_ms);
25508 __tmp.put_i16_le(self.chan1_scaled);
25509 __tmp.put_i16_le(self.chan2_scaled);
25510 __tmp.put_i16_le(self.chan3_scaled);
25511 __tmp.put_i16_le(self.chan4_scaled);
25512 __tmp.put_i16_le(self.chan5_scaled);
25513 __tmp.put_i16_le(self.chan6_scaled);
25514 __tmp.put_i16_le(self.chan7_scaled);
25515 __tmp.put_i16_le(self.chan8_scaled);
25516 __tmp.put_u8(self.port);
25517 __tmp.put_u8(self.rssi);
25518 if matches!(version, MavlinkVersion::V2) {
25519 let len = __tmp.len();
25520 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
25521 } else {
25522 __tmp.len()
25523 }
25524 }
25525}
25526#[deprecated = " See `MAV_CMD_SET_MESSAGE_INTERVAL ` (Deprecated since 2015-08)"]
25527#[doc = "Request a data stream."]
25528#[doc = ""]
25529#[doc = "ID: 66"]
25530#[derive(Debug, Clone, PartialEq)]
25531#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
25532#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
25533pub struct REQUEST_DATA_STREAM_DATA {
25534 #[doc = "The requested message rate"]
25535 pub req_message_rate: u16,
25536 #[doc = "The target requested to send the message stream."]
25537 pub target_system: u8,
25538 #[doc = "The target requested to send the message stream."]
25539 pub target_component: u8,
25540 #[doc = "The ID of the requested data stream"]
25541 pub req_stream_id: u8,
25542 #[doc = "1 to start sending, 0 to stop sending."]
25543 pub start_stop: u8,
25544}
25545impl REQUEST_DATA_STREAM_DATA {
25546 pub const ENCODED_LEN: usize = 6usize;
25547 pub const DEFAULT: Self = Self {
25548 req_message_rate: 0_u16,
25549 target_system: 0_u8,
25550 target_component: 0_u8,
25551 req_stream_id: 0_u8,
25552 start_stop: 0_u8,
25553 };
25554 #[cfg(feature = "arbitrary")]
25555 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
25556 use arbitrary::{Arbitrary, Unstructured};
25557 let mut buf = [0u8; 1024];
25558 rng.fill_bytes(&mut buf);
25559 let mut unstructured = Unstructured::new(&buf);
25560 Self::arbitrary(&mut unstructured).unwrap_or_default()
25561 }
25562}
25563impl Default for REQUEST_DATA_STREAM_DATA {
25564 fn default() -> Self {
25565 Self::DEFAULT.clone()
25566 }
25567}
25568impl MessageData for REQUEST_DATA_STREAM_DATA {
25569 type Message = MavMessage;
25570 const ID: u32 = 66u32;
25571 const NAME: &'static str = "REQUEST_DATA_STREAM";
25572 const EXTRA_CRC: u8 = 148u8;
25573 const ENCODED_LEN: usize = 6usize;
25574 fn deser(
25575 _version: MavlinkVersion,
25576 __input: &[u8],
25577 ) -> Result<Self, ::mavlink_core::error::ParserError> {
25578 let avail_len = __input.len();
25579 let mut payload_buf = [0; Self::ENCODED_LEN];
25580 let mut buf = if avail_len < Self::ENCODED_LEN {
25581 payload_buf[0..avail_len].copy_from_slice(__input);
25582 Bytes::new(&payload_buf)
25583 } else {
25584 Bytes::new(__input)
25585 };
25586 let mut __struct = Self::default();
25587 __struct.req_message_rate = buf.get_u16_le();
25588 __struct.target_system = buf.get_u8();
25589 __struct.target_component = buf.get_u8();
25590 __struct.req_stream_id = buf.get_u8();
25591 __struct.start_stop = buf.get_u8();
25592 Ok(__struct)
25593 }
25594 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
25595 let mut __tmp = BytesMut::new(bytes);
25596 #[allow(clippy::absurd_extreme_comparisons)]
25597 #[allow(unused_comparisons)]
25598 if __tmp.remaining() < Self::ENCODED_LEN {
25599 panic!(
25600 "buffer is too small (need {} bytes, but got {})",
25601 Self::ENCODED_LEN,
25602 __tmp.remaining(),
25603 )
25604 }
25605 __tmp.put_u16_le(self.req_message_rate);
25606 __tmp.put_u8(self.target_system);
25607 __tmp.put_u8(self.target_component);
25608 __tmp.put_u8(self.req_stream_id);
25609 __tmp.put_u8(self.start_stop);
25610 if matches!(version, MavlinkVersion::V2) {
25611 let len = __tmp.len();
25612 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
25613 } else {
25614 __tmp.len()
25615 }
25616 }
25617}
25618#[doc = "Request one or more events to be (re-)sent. If first_sequence==last_sequence, only a single event is requested. Note that first_sequence can be larger than last_sequence (because the sequence number can wrap). Each sequence will trigger an EVENT or EVENT_ERROR response."]
25619#[doc = ""]
25620#[doc = "ID: 412"]
25621#[derive(Debug, Clone, PartialEq)]
25622#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
25623#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
25624pub struct REQUEST_EVENT_DATA {
25625 #[doc = "First sequence number of the requested event."]
25626 pub first_sequence: u16,
25627 #[doc = "Last sequence number of the requested event."]
25628 pub last_sequence: u16,
25629 #[doc = "System ID"]
25630 pub target_system: u8,
25631 #[doc = "Component ID"]
25632 pub target_component: u8,
25633}
25634impl REQUEST_EVENT_DATA {
25635 pub const ENCODED_LEN: usize = 6usize;
25636 pub const DEFAULT: Self = Self {
25637 first_sequence: 0_u16,
25638 last_sequence: 0_u16,
25639 target_system: 0_u8,
25640 target_component: 0_u8,
25641 };
25642 #[cfg(feature = "arbitrary")]
25643 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
25644 use arbitrary::{Arbitrary, Unstructured};
25645 let mut buf = [0u8; 1024];
25646 rng.fill_bytes(&mut buf);
25647 let mut unstructured = Unstructured::new(&buf);
25648 Self::arbitrary(&mut unstructured).unwrap_or_default()
25649 }
25650}
25651impl Default for REQUEST_EVENT_DATA {
25652 fn default() -> Self {
25653 Self::DEFAULT.clone()
25654 }
25655}
25656impl MessageData for REQUEST_EVENT_DATA {
25657 type Message = MavMessage;
25658 const ID: u32 = 412u32;
25659 const NAME: &'static str = "REQUEST_EVENT";
25660 const EXTRA_CRC: u8 = 33u8;
25661 const ENCODED_LEN: usize = 6usize;
25662 fn deser(
25663 _version: MavlinkVersion,
25664 __input: &[u8],
25665 ) -> Result<Self, ::mavlink_core::error::ParserError> {
25666 let avail_len = __input.len();
25667 let mut payload_buf = [0; Self::ENCODED_LEN];
25668 let mut buf = if avail_len < Self::ENCODED_LEN {
25669 payload_buf[0..avail_len].copy_from_slice(__input);
25670 Bytes::new(&payload_buf)
25671 } else {
25672 Bytes::new(__input)
25673 };
25674 let mut __struct = Self::default();
25675 __struct.first_sequence = buf.get_u16_le();
25676 __struct.last_sequence = buf.get_u16_le();
25677 __struct.target_system = buf.get_u8();
25678 __struct.target_component = buf.get_u8();
25679 Ok(__struct)
25680 }
25681 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
25682 let mut __tmp = BytesMut::new(bytes);
25683 #[allow(clippy::absurd_extreme_comparisons)]
25684 #[allow(unused_comparisons)]
25685 if __tmp.remaining() < Self::ENCODED_LEN {
25686 panic!(
25687 "buffer is too small (need {} bytes, but got {})",
25688 Self::ENCODED_LEN,
25689 __tmp.remaining(),
25690 )
25691 }
25692 __tmp.put_u16_le(self.first_sequence);
25693 __tmp.put_u16_le(self.last_sequence);
25694 __tmp.put_u8(self.target_system);
25695 __tmp.put_u8(self.target_component);
25696 if matches!(version, MavlinkVersion::V2) {
25697 let len = __tmp.len();
25698 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
25699 } else {
25700 __tmp.len()
25701 }
25702 }
25703}
25704#[doc = "The autopilot is requesting a resource (file, binary, other type of data)."]
25705#[doc = ""]
25706#[doc = "ID: 142"]
25707#[derive(Debug, Clone, PartialEq)]
25708#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
25709#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
25710pub struct RESOURCE_REQUEST_DATA {
25711 #[doc = "Request ID. This ID should be re-used when sending back URI contents"]
25712 pub request_id: u8,
25713 #[doc = "The type of requested URI. 0 = a file via URL. 1 = a UAVCAN binary"]
25714 pub uri_type: u8,
25715 #[doc = "The requested unique resource identifier (URI). It is not necessarily a straight domain name (depends on the URI type enum)"]
25716 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
25717 pub uri: [u8; 120],
25718 #[doc = "The way the autopilot wants to receive the URI. 0 = MAVLink FTP. 1 = binary stream."]
25719 pub transfer_type: u8,
25720 #[doc = "The storage path the autopilot wants the URI to be stored in. Will only be valid if the transfer_type has a storage associated (e.g. MAVLink FTP)."]
25721 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
25722 pub storage: [u8; 120],
25723}
25724impl RESOURCE_REQUEST_DATA {
25725 pub const ENCODED_LEN: usize = 243usize;
25726 pub const DEFAULT: Self = Self {
25727 request_id: 0_u8,
25728 uri_type: 0_u8,
25729 uri: [0_u8; 120usize],
25730 transfer_type: 0_u8,
25731 storage: [0_u8; 120usize],
25732 };
25733 #[cfg(feature = "arbitrary")]
25734 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
25735 use arbitrary::{Arbitrary, Unstructured};
25736 let mut buf = [0u8; 1024];
25737 rng.fill_bytes(&mut buf);
25738 let mut unstructured = Unstructured::new(&buf);
25739 Self::arbitrary(&mut unstructured).unwrap_or_default()
25740 }
25741}
25742impl Default for RESOURCE_REQUEST_DATA {
25743 fn default() -> Self {
25744 Self::DEFAULT.clone()
25745 }
25746}
25747impl MessageData for RESOURCE_REQUEST_DATA {
25748 type Message = MavMessage;
25749 const ID: u32 = 142u32;
25750 const NAME: &'static str = "RESOURCE_REQUEST";
25751 const EXTRA_CRC: u8 = 72u8;
25752 const ENCODED_LEN: usize = 243usize;
25753 fn deser(
25754 _version: MavlinkVersion,
25755 __input: &[u8],
25756 ) -> Result<Self, ::mavlink_core::error::ParserError> {
25757 let avail_len = __input.len();
25758 let mut payload_buf = [0; Self::ENCODED_LEN];
25759 let mut buf = if avail_len < Self::ENCODED_LEN {
25760 payload_buf[0..avail_len].copy_from_slice(__input);
25761 Bytes::new(&payload_buf)
25762 } else {
25763 Bytes::new(__input)
25764 };
25765 let mut __struct = Self::default();
25766 __struct.request_id = buf.get_u8();
25767 __struct.uri_type = buf.get_u8();
25768 for v in &mut __struct.uri {
25769 let val = buf.get_u8();
25770 *v = val;
25771 }
25772 __struct.transfer_type = buf.get_u8();
25773 for v in &mut __struct.storage {
25774 let val = buf.get_u8();
25775 *v = val;
25776 }
25777 Ok(__struct)
25778 }
25779 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
25780 let mut __tmp = BytesMut::new(bytes);
25781 #[allow(clippy::absurd_extreme_comparisons)]
25782 #[allow(unused_comparisons)]
25783 if __tmp.remaining() < Self::ENCODED_LEN {
25784 panic!(
25785 "buffer is too small (need {} bytes, but got {})",
25786 Self::ENCODED_LEN,
25787 __tmp.remaining(),
25788 )
25789 }
25790 __tmp.put_u8(self.request_id);
25791 __tmp.put_u8(self.uri_type);
25792 for val in &self.uri {
25793 __tmp.put_u8(*val);
25794 }
25795 __tmp.put_u8(self.transfer_type);
25796 for val in &self.storage {
25797 __tmp.put_u8(*val);
25798 }
25799 if matches!(version, MavlinkVersion::V2) {
25800 let len = __tmp.len();
25801 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
25802 } else {
25803 __tmp.len()
25804 }
25805 }
25806}
25807#[doc = "Response to a REQUEST_EVENT in case of an error (e.g. the event is not available anymore)."]
25808#[doc = ""]
25809#[doc = "ID: 413"]
25810#[derive(Debug, Clone, PartialEq)]
25811#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
25812#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
25813pub struct RESPONSE_EVENT_ERROR_DATA {
25814 #[doc = "Sequence number."]
25815 pub sequence: u16,
25816 #[doc = "Oldest Sequence number that is still available after the sequence set in REQUEST_EVENT."]
25817 pub sequence_oldest_available: u16,
25818 #[doc = "System ID"]
25819 pub target_system: u8,
25820 #[doc = "Component ID"]
25821 pub target_component: u8,
25822 #[doc = "Error reason."]
25823 pub reason: MavEventErrorReason,
25824}
25825impl RESPONSE_EVENT_ERROR_DATA {
25826 pub const ENCODED_LEN: usize = 7usize;
25827 pub const DEFAULT: Self = Self {
25828 sequence: 0_u16,
25829 sequence_oldest_available: 0_u16,
25830 target_system: 0_u8,
25831 target_component: 0_u8,
25832 reason: MavEventErrorReason::DEFAULT,
25833 };
25834 #[cfg(feature = "arbitrary")]
25835 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
25836 use arbitrary::{Arbitrary, Unstructured};
25837 let mut buf = [0u8; 1024];
25838 rng.fill_bytes(&mut buf);
25839 let mut unstructured = Unstructured::new(&buf);
25840 Self::arbitrary(&mut unstructured).unwrap_or_default()
25841 }
25842}
25843impl Default for RESPONSE_EVENT_ERROR_DATA {
25844 fn default() -> Self {
25845 Self::DEFAULT.clone()
25846 }
25847}
25848impl MessageData for RESPONSE_EVENT_ERROR_DATA {
25849 type Message = MavMessage;
25850 const ID: u32 = 413u32;
25851 const NAME: &'static str = "RESPONSE_EVENT_ERROR";
25852 const EXTRA_CRC: u8 = 77u8;
25853 const ENCODED_LEN: usize = 7usize;
25854 fn deser(
25855 _version: MavlinkVersion,
25856 __input: &[u8],
25857 ) -> Result<Self, ::mavlink_core::error::ParserError> {
25858 let avail_len = __input.len();
25859 let mut payload_buf = [0; Self::ENCODED_LEN];
25860 let mut buf = if avail_len < Self::ENCODED_LEN {
25861 payload_buf[0..avail_len].copy_from_slice(__input);
25862 Bytes::new(&payload_buf)
25863 } else {
25864 Bytes::new(__input)
25865 };
25866 let mut __struct = Self::default();
25867 __struct.sequence = buf.get_u16_le();
25868 __struct.sequence_oldest_available = buf.get_u16_le();
25869 __struct.target_system = buf.get_u8();
25870 __struct.target_component = buf.get_u8();
25871 let tmp = buf.get_u8();
25872 __struct.reason =
25873 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
25874 enum_type: "MavEventErrorReason",
25875 value: tmp as u32,
25876 })?;
25877 Ok(__struct)
25878 }
25879 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
25880 let mut __tmp = BytesMut::new(bytes);
25881 #[allow(clippy::absurd_extreme_comparisons)]
25882 #[allow(unused_comparisons)]
25883 if __tmp.remaining() < Self::ENCODED_LEN {
25884 panic!(
25885 "buffer is too small (need {} bytes, but got {})",
25886 Self::ENCODED_LEN,
25887 __tmp.remaining(),
25888 )
25889 }
25890 __tmp.put_u16_le(self.sequence);
25891 __tmp.put_u16_le(self.sequence_oldest_available);
25892 __tmp.put_u8(self.target_system);
25893 __tmp.put_u8(self.target_component);
25894 __tmp.put_u8(self.reason as u8);
25895 if matches!(version, MavlinkVersion::V2) {
25896 let len = __tmp.len();
25897 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
25898 } else {
25899 __tmp.len()
25900 }
25901 }
25902}
25903#[doc = "Read out the safety zone the MAV currently assumes."]
25904#[doc = ""]
25905#[doc = "ID: 55"]
25906#[derive(Debug, Clone, PartialEq)]
25907#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
25908#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
25909pub struct SAFETY_ALLOWED_AREA_DATA {
25910 #[doc = "x position 1 / Latitude 1"]
25911 pub p1x: f32,
25912 #[doc = "y position 1 / Longitude 1"]
25913 pub p1y: f32,
25914 #[doc = "z position 1 / Altitude 1"]
25915 pub p1z: f32,
25916 #[doc = "x position 2 / Latitude 2"]
25917 pub p2x: f32,
25918 #[doc = "y position 2 / Longitude 2"]
25919 pub p2y: f32,
25920 #[doc = "z position 2 / Altitude 2"]
25921 pub p2z: f32,
25922 #[doc = "Coordinate frame. Can be either global, GPS, right-handed with Z axis up or local, right handed, Z axis down."]
25923 pub frame: MavFrame,
25924}
25925impl SAFETY_ALLOWED_AREA_DATA {
25926 pub const ENCODED_LEN: usize = 25usize;
25927 pub const DEFAULT: Self = Self {
25928 p1x: 0.0_f32,
25929 p1y: 0.0_f32,
25930 p1z: 0.0_f32,
25931 p2x: 0.0_f32,
25932 p2y: 0.0_f32,
25933 p2z: 0.0_f32,
25934 frame: MavFrame::DEFAULT,
25935 };
25936 #[cfg(feature = "arbitrary")]
25937 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
25938 use arbitrary::{Arbitrary, Unstructured};
25939 let mut buf = [0u8; 1024];
25940 rng.fill_bytes(&mut buf);
25941 let mut unstructured = Unstructured::new(&buf);
25942 Self::arbitrary(&mut unstructured).unwrap_or_default()
25943 }
25944}
25945impl Default for SAFETY_ALLOWED_AREA_DATA {
25946 fn default() -> Self {
25947 Self::DEFAULT.clone()
25948 }
25949}
25950impl MessageData for SAFETY_ALLOWED_AREA_DATA {
25951 type Message = MavMessage;
25952 const ID: u32 = 55u32;
25953 const NAME: &'static str = "SAFETY_ALLOWED_AREA";
25954 const EXTRA_CRC: u8 = 3u8;
25955 const ENCODED_LEN: usize = 25usize;
25956 fn deser(
25957 _version: MavlinkVersion,
25958 __input: &[u8],
25959 ) -> Result<Self, ::mavlink_core::error::ParserError> {
25960 let avail_len = __input.len();
25961 let mut payload_buf = [0; Self::ENCODED_LEN];
25962 let mut buf = if avail_len < Self::ENCODED_LEN {
25963 payload_buf[0..avail_len].copy_from_slice(__input);
25964 Bytes::new(&payload_buf)
25965 } else {
25966 Bytes::new(__input)
25967 };
25968 let mut __struct = Self::default();
25969 __struct.p1x = buf.get_f32_le();
25970 __struct.p1y = buf.get_f32_le();
25971 __struct.p1z = buf.get_f32_le();
25972 __struct.p2x = buf.get_f32_le();
25973 __struct.p2y = buf.get_f32_le();
25974 __struct.p2z = buf.get_f32_le();
25975 let tmp = buf.get_u8();
25976 __struct.frame =
25977 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
25978 enum_type: "MavFrame",
25979 value: tmp as u32,
25980 })?;
25981 Ok(__struct)
25982 }
25983 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
25984 let mut __tmp = BytesMut::new(bytes);
25985 #[allow(clippy::absurd_extreme_comparisons)]
25986 #[allow(unused_comparisons)]
25987 if __tmp.remaining() < Self::ENCODED_LEN {
25988 panic!(
25989 "buffer is too small (need {} bytes, but got {})",
25990 Self::ENCODED_LEN,
25991 __tmp.remaining(),
25992 )
25993 }
25994 __tmp.put_f32_le(self.p1x);
25995 __tmp.put_f32_le(self.p1y);
25996 __tmp.put_f32_le(self.p1z);
25997 __tmp.put_f32_le(self.p2x);
25998 __tmp.put_f32_le(self.p2y);
25999 __tmp.put_f32_le(self.p2z);
26000 __tmp.put_u8(self.frame as u8);
26001 if matches!(version, MavlinkVersion::V2) {
26002 let len = __tmp.len();
26003 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
26004 } else {
26005 __tmp.len()
26006 }
26007 }
26008}
26009#[doc = "Set a safety zone (volume), which is defined by two corners of a cube. This message can be used to tell the MAV which setpoints/waypoints to accept and which to reject. Safety areas are often enforced by national or competition regulations."]
26010#[doc = ""]
26011#[doc = "ID: 54"]
26012#[derive(Debug, Clone, PartialEq)]
26013#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
26014#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
26015pub struct SAFETY_SET_ALLOWED_AREA_DATA {
26016 #[doc = "x position 1 / Latitude 1"]
26017 pub p1x: f32,
26018 #[doc = "y position 1 / Longitude 1"]
26019 pub p1y: f32,
26020 #[doc = "z position 1 / Altitude 1"]
26021 pub p1z: f32,
26022 #[doc = "x position 2 / Latitude 2"]
26023 pub p2x: f32,
26024 #[doc = "y position 2 / Longitude 2"]
26025 pub p2y: f32,
26026 #[doc = "z position 2 / Altitude 2"]
26027 pub p2z: f32,
26028 #[doc = "System ID"]
26029 pub target_system: u8,
26030 #[doc = "Component ID"]
26031 pub target_component: u8,
26032 #[doc = "Coordinate frame. Can be either global, GPS, right-handed with Z axis up or local, right handed, Z axis down."]
26033 pub frame: MavFrame,
26034}
26035impl SAFETY_SET_ALLOWED_AREA_DATA {
26036 pub const ENCODED_LEN: usize = 27usize;
26037 pub const DEFAULT: Self = Self {
26038 p1x: 0.0_f32,
26039 p1y: 0.0_f32,
26040 p1z: 0.0_f32,
26041 p2x: 0.0_f32,
26042 p2y: 0.0_f32,
26043 p2z: 0.0_f32,
26044 target_system: 0_u8,
26045 target_component: 0_u8,
26046 frame: MavFrame::DEFAULT,
26047 };
26048 #[cfg(feature = "arbitrary")]
26049 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
26050 use arbitrary::{Arbitrary, Unstructured};
26051 let mut buf = [0u8; 1024];
26052 rng.fill_bytes(&mut buf);
26053 let mut unstructured = Unstructured::new(&buf);
26054 Self::arbitrary(&mut unstructured).unwrap_or_default()
26055 }
26056}
26057impl Default for SAFETY_SET_ALLOWED_AREA_DATA {
26058 fn default() -> Self {
26059 Self::DEFAULT.clone()
26060 }
26061}
26062impl MessageData for SAFETY_SET_ALLOWED_AREA_DATA {
26063 type Message = MavMessage;
26064 const ID: u32 = 54u32;
26065 const NAME: &'static str = "SAFETY_SET_ALLOWED_AREA";
26066 const EXTRA_CRC: u8 = 15u8;
26067 const ENCODED_LEN: usize = 27usize;
26068 fn deser(
26069 _version: MavlinkVersion,
26070 __input: &[u8],
26071 ) -> Result<Self, ::mavlink_core::error::ParserError> {
26072 let avail_len = __input.len();
26073 let mut payload_buf = [0; Self::ENCODED_LEN];
26074 let mut buf = if avail_len < Self::ENCODED_LEN {
26075 payload_buf[0..avail_len].copy_from_slice(__input);
26076 Bytes::new(&payload_buf)
26077 } else {
26078 Bytes::new(__input)
26079 };
26080 let mut __struct = Self::default();
26081 __struct.p1x = buf.get_f32_le();
26082 __struct.p1y = buf.get_f32_le();
26083 __struct.p1z = buf.get_f32_le();
26084 __struct.p2x = buf.get_f32_le();
26085 __struct.p2y = buf.get_f32_le();
26086 __struct.p2z = buf.get_f32_le();
26087 __struct.target_system = buf.get_u8();
26088 __struct.target_component = buf.get_u8();
26089 let tmp = buf.get_u8();
26090 __struct.frame =
26091 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
26092 enum_type: "MavFrame",
26093 value: tmp as u32,
26094 })?;
26095 Ok(__struct)
26096 }
26097 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
26098 let mut __tmp = BytesMut::new(bytes);
26099 #[allow(clippy::absurd_extreme_comparisons)]
26100 #[allow(unused_comparisons)]
26101 if __tmp.remaining() < Self::ENCODED_LEN {
26102 panic!(
26103 "buffer is too small (need {} bytes, but got {})",
26104 Self::ENCODED_LEN,
26105 __tmp.remaining(),
26106 )
26107 }
26108 __tmp.put_f32_le(self.p1x);
26109 __tmp.put_f32_le(self.p1y);
26110 __tmp.put_f32_le(self.p1z);
26111 __tmp.put_f32_le(self.p2x);
26112 __tmp.put_f32_le(self.p2y);
26113 __tmp.put_f32_le(self.p2z);
26114 __tmp.put_u8(self.target_system);
26115 __tmp.put_u8(self.target_component);
26116 __tmp.put_u8(self.frame as u8);
26117 if matches!(version, MavlinkVersion::V2) {
26118 let len = __tmp.len();
26119 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
26120 } else {
26121 __tmp.len()
26122 }
26123 }
26124}
26125#[doc = "The RAW IMU readings for the usual 9DOF sensor setup. This message should contain the scaled values to the described units."]
26126#[doc = ""]
26127#[doc = "ID: 26"]
26128#[derive(Debug, Clone, PartialEq)]
26129#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
26130#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
26131pub struct SCALED_IMU_DATA {
26132 #[doc = "Timestamp (time since system boot)."]
26133 pub time_boot_ms: u32,
26134 #[doc = "X acceleration"]
26135 pub xacc: i16,
26136 #[doc = "Y acceleration"]
26137 pub yacc: i16,
26138 #[doc = "Z acceleration"]
26139 pub zacc: i16,
26140 #[doc = "Angular speed around X axis"]
26141 pub xgyro: i16,
26142 #[doc = "Angular speed around Y axis"]
26143 pub ygyro: i16,
26144 #[doc = "Angular speed around Z axis"]
26145 pub zgyro: i16,
26146 #[doc = "X Magnetic field"]
26147 pub xmag: i16,
26148 #[doc = "Y Magnetic field"]
26149 pub ymag: i16,
26150 #[doc = "Z Magnetic field"]
26151 pub zmag: i16,
26152 #[doc = "Temperature, 0: IMU does not provide temperature values. If the IMU is at 0C it must send 1 (0.01C)."]
26153 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
26154 pub temperature: i16,
26155}
26156impl SCALED_IMU_DATA {
26157 pub const ENCODED_LEN: usize = 24usize;
26158 pub const DEFAULT: Self = Self {
26159 time_boot_ms: 0_u32,
26160 xacc: 0_i16,
26161 yacc: 0_i16,
26162 zacc: 0_i16,
26163 xgyro: 0_i16,
26164 ygyro: 0_i16,
26165 zgyro: 0_i16,
26166 xmag: 0_i16,
26167 ymag: 0_i16,
26168 zmag: 0_i16,
26169 temperature: 0_i16,
26170 };
26171 #[cfg(feature = "arbitrary")]
26172 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
26173 use arbitrary::{Arbitrary, Unstructured};
26174 let mut buf = [0u8; 1024];
26175 rng.fill_bytes(&mut buf);
26176 let mut unstructured = Unstructured::new(&buf);
26177 Self::arbitrary(&mut unstructured).unwrap_or_default()
26178 }
26179}
26180impl Default for SCALED_IMU_DATA {
26181 fn default() -> Self {
26182 Self::DEFAULT.clone()
26183 }
26184}
26185impl MessageData for SCALED_IMU_DATA {
26186 type Message = MavMessage;
26187 const ID: u32 = 26u32;
26188 const NAME: &'static str = "SCALED_IMU";
26189 const EXTRA_CRC: u8 = 170u8;
26190 const ENCODED_LEN: usize = 24usize;
26191 fn deser(
26192 _version: MavlinkVersion,
26193 __input: &[u8],
26194 ) -> Result<Self, ::mavlink_core::error::ParserError> {
26195 let avail_len = __input.len();
26196 let mut payload_buf = [0; Self::ENCODED_LEN];
26197 let mut buf = if avail_len < Self::ENCODED_LEN {
26198 payload_buf[0..avail_len].copy_from_slice(__input);
26199 Bytes::new(&payload_buf)
26200 } else {
26201 Bytes::new(__input)
26202 };
26203 let mut __struct = Self::default();
26204 __struct.time_boot_ms = buf.get_u32_le();
26205 __struct.xacc = buf.get_i16_le();
26206 __struct.yacc = buf.get_i16_le();
26207 __struct.zacc = buf.get_i16_le();
26208 __struct.xgyro = buf.get_i16_le();
26209 __struct.ygyro = buf.get_i16_le();
26210 __struct.zgyro = buf.get_i16_le();
26211 __struct.xmag = buf.get_i16_le();
26212 __struct.ymag = buf.get_i16_le();
26213 __struct.zmag = buf.get_i16_le();
26214 __struct.temperature = buf.get_i16_le();
26215 Ok(__struct)
26216 }
26217 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
26218 let mut __tmp = BytesMut::new(bytes);
26219 #[allow(clippy::absurd_extreme_comparisons)]
26220 #[allow(unused_comparisons)]
26221 if __tmp.remaining() < Self::ENCODED_LEN {
26222 panic!(
26223 "buffer is too small (need {} bytes, but got {})",
26224 Self::ENCODED_LEN,
26225 __tmp.remaining(),
26226 )
26227 }
26228 __tmp.put_u32_le(self.time_boot_ms);
26229 __tmp.put_i16_le(self.xacc);
26230 __tmp.put_i16_le(self.yacc);
26231 __tmp.put_i16_le(self.zacc);
26232 __tmp.put_i16_le(self.xgyro);
26233 __tmp.put_i16_le(self.ygyro);
26234 __tmp.put_i16_le(self.zgyro);
26235 __tmp.put_i16_le(self.xmag);
26236 __tmp.put_i16_le(self.ymag);
26237 __tmp.put_i16_le(self.zmag);
26238 if matches!(version, MavlinkVersion::V2) {
26239 __tmp.put_i16_le(self.temperature);
26240 let len = __tmp.len();
26241 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
26242 } else {
26243 __tmp.len()
26244 }
26245 }
26246}
26247#[doc = "The RAW IMU readings for secondary 9DOF sensor setup. This message should contain the scaled values to the described units."]
26248#[doc = ""]
26249#[doc = "ID: 116"]
26250#[derive(Debug, Clone, PartialEq)]
26251#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
26252#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
26253pub struct SCALED_IMU2_DATA {
26254 #[doc = "Timestamp (time since system boot)."]
26255 pub time_boot_ms: u32,
26256 #[doc = "X acceleration"]
26257 pub xacc: i16,
26258 #[doc = "Y acceleration"]
26259 pub yacc: i16,
26260 #[doc = "Z acceleration"]
26261 pub zacc: i16,
26262 #[doc = "Angular speed around X axis"]
26263 pub xgyro: i16,
26264 #[doc = "Angular speed around Y axis"]
26265 pub ygyro: i16,
26266 #[doc = "Angular speed around Z axis"]
26267 pub zgyro: i16,
26268 #[doc = "X Magnetic field"]
26269 pub xmag: i16,
26270 #[doc = "Y Magnetic field"]
26271 pub ymag: i16,
26272 #[doc = "Z Magnetic field"]
26273 pub zmag: i16,
26274 #[doc = "Temperature, 0: IMU does not provide temperature values. If the IMU is at 0C it must send 1 (0.01C)."]
26275 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
26276 pub temperature: i16,
26277}
26278impl SCALED_IMU2_DATA {
26279 pub const ENCODED_LEN: usize = 24usize;
26280 pub const DEFAULT: Self = Self {
26281 time_boot_ms: 0_u32,
26282 xacc: 0_i16,
26283 yacc: 0_i16,
26284 zacc: 0_i16,
26285 xgyro: 0_i16,
26286 ygyro: 0_i16,
26287 zgyro: 0_i16,
26288 xmag: 0_i16,
26289 ymag: 0_i16,
26290 zmag: 0_i16,
26291 temperature: 0_i16,
26292 };
26293 #[cfg(feature = "arbitrary")]
26294 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
26295 use arbitrary::{Arbitrary, Unstructured};
26296 let mut buf = [0u8; 1024];
26297 rng.fill_bytes(&mut buf);
26298 let mut unstructured = Unstructured::new(&buf);
26299 Self::arbitrary(&mut unstructured).unwrap_or_default()
26300 }
26301}
26302impl Default for SCALED_IMU2_DATA {
26303 fn default() -> Self {
26304 Self::DEFAULT.clone()
26305 }
26306}
26307impl MessageData for SCALED_IMU2_DATA {
26308 type Message = MavMessage;
26309 const ID: u32 = 116u32;
26310 const NAME: &'static str = "SCALED_IMU2";
26311 const EXTRA_CRC: u8 = 76u8;
26312 const ENCODED_LEN: usize = 24usize;
26313 fn deser(
26314 _version: MavlinkVersion,
26315 __input: &[u8],
26316 ) -> Result<Self, ::mavlink_core::error::ParserError> {
26317 let avail_len = __input.len();
26318 let mut payload_buf = [0; Self::ENCODED_LEN];
26319 let mut buf = if avail_len < Self::ENCODED_LEN {
26320 payload_buf[0..avail_len].copy_from_slice(__input);
26321 Bytes::new(&payload_buf)
26322 } else {
26323 Bytes::new(__input)
26324 };
26325 let mut __struct = Self::default();
26326 __struct.time_boot_ms = buf.get_u32_le();
26327 __struct.xacc = buf.get_i16_le();
26328 __struct.yacc = buf.get_i16_le();
26329 __struct.zacc = buf.get_i16_le();
26330 __struct.xgyro = buf.get_i16_le();
26331 __struct.ygyro = buf.get_i16_le();
26332 __struct.zgyro = buf.get_i16_le();
26333 __struct.xmag = buf.get_i16_le();
26334 __struct.ymag = buf.get_i16_le();
26335 __struct.zmag = buf.get_i16_le();
26336 __struct.temperature = buf.get_i16_le();
26337 Ok(__struct)
26338 }
26339 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
26340 let mut __tmp = BytesMut::new(bytes);
26341 #[allow(clippy::absurd_extreme_comparisons)]
26342 #[allow(unused_comparisons)]
26343 if __tmp.remaining() < Self::ENCODED_LEN {
26344 panic!(
26345 "buffer is too small (need {} bytes, but got {})",
26346 Self::ENCODED_LEN,
26347 __tmp.remaining(),
26348 )
26349 }
26350 __tmp.put_u32_le(self.time_boot_ms);
26351 __tmp.put_i16_le(self.xacc);
26352 __tmp.put_i16_le(self.yacc);
26353 __tmp.put_i16_le(self.zacc);
26354 __tmp.put_i16_le(self.xgyro);
26355 __tmp.put_i16_le(self.ygyro);
26356 __tmp.put_i16_le(self.zgyro);
26357 __tmp.put_i16_le(self.xmag);
26358 __tmp.put_i16_le(self.ymag);
26359 __tmp.put_i16_le(self.zmag);
26360 if matches!(version, MavlinkVersion::V2) {
26361 __tmp.put_i16_le(self.temperature);
26362 let len = __tmp.len();
26363 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
26364 } else {
26365 __tmp.len()
26366 }
26367 }
26368}
26369#[doc = "The RAW IMU readings for 3rd 9DOF sensor setup. This message should contain the scaled values to the described units."]
26370#[doc = ""]
26371#[doc = "ID: 129"]
26372#[derive(Debug, Clone, PartialEq)]
26373#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
26374#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
26375pub struct SCALED_IMU3_DATA {
26376 #[doc = "Timestamp (time since system boot)."]
26377 pub time_boot_ms: u32,
26378 #[doc = "X acceleration"]
26379 pub xacc: i16,
26380 #[doc = "Y acceleration"]
26381 pub yacc: i16,
26382 #[doc = "Z acceleration"]
26383 pub zacc: i16,
26384 #[doc = "Angular speed around X axis"]
26385 pub xgyro: i16,
26386 #[doc = "Angular speed around Y axis"]
26387 pub ygyro: i16,
26388 #[doc = "Angular speed around Z axis"]
26389 pub zgyro: i16,
26390 #[doc = "X Magnetic field"]
26391 pub xmag: i16,
26392 #[doc = "Y Magnetic field"]
26393 pub ymag: i16,
26394 #[doc = "Z Magnetic field"]
26395 pub zmag: i16,
26396 #[doc = "Temperature, 0: IMU does not provide temperature values. If the IMU is at 0C it must send 1 (0.01C)."]
26397 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
26398 pub temperature: i16,
26399}
26400impl SCALED_IMU3_DATA {
26401 pub const ENCODED_LEN: usize = 24usize;
26402 pub const DEFAULT: Self = Self {
26403 time_boot_ms: 0_u32,
26404 xacc: 0_i16,
26405 yacc: 0_i16,
26406 zacc: 0_i16,
26407 xgyro: 0_i16,
26408 ygyro: 0_i16,
26409 zgyro: 0_i16,
26410 xmag: 0_i16,
26411 ymag: 0_i16,
26412 zmag: 0_i16,
26413 temperature: 0_i16,
26414 };
26415 #[cfg(feature = "arbitrary")]
26416 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
26417 use arbitrary::{Arbitrary, Unstructured};
26418 let mut buf = [0u8; 1024];
26419 rng.fill_bytes(&mut buf);
26420 let mut unstructured = Unstructured::new(&buf);
26421 Self::arbitrary(&mut unstructured).unwrap_or_default()
26422 }
26423}
26424impl Default for SCALED_IMU3_DATA {
26425 fn default() -> Self {
26426 Self::DEFAULT.clone()
26427 }
26428}
26429impl MessageData for SCALED_IMU3_DATA {
26430 type Message = MavMessage;
26431 const ID: u32 = 129u32;
26432 const NAME: &'static str = "SCALED_IMU3";
26433 const EXTRA_CRC: u8 = 46u8;
26434 const ENCODED_LEN: usize = 24usize;
26435 fn deser(
26436 _version: MavlinkVersion,
26437 __input: &[u8],
26438 ) -> Result<Self, ::mavlink_core::error::ParserError> {
26439 let avail_len = __input.len();
26440 let mut payload_buf = [0; Self::ENCODED_LEN];
26441 let mut buf = if avail_len < Self::ENCODED_LEN {
26442 payload_buf[0..avail_len].copy_from_slice(__input);
26443 Bytes::new(&payload_buf)
26444 } else {
26445 Bytes::new(__input)
26446 };
26447 let mut __struct = Self::default();
26448 __struct.time_boot_ms = buf.get_u32_le();
26449 __struct.xacc = buf.get_i16_le();
26450 __struct.yacc = buf.get_i16_le();
26451 __struct.zacc = buf.get_i16_le();
26452 __struct.xgyro = buf.get_i16_le();
26453 __struct.ygyro = buf.get_i16_le();
26454 __struct.zgyro = buf.get_i16_le();
26455 __struct.xmag = buf.get_i16_le();
26456 __struct.ymag = buf.get_i16_le();
26457 __struct.zmag = buf.get_i16_le();
26458 __struct.temperature = buf.get_i16_le();
26459 Ok(__struct)
26460 }
26461 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
26462 let mut __tmp = BytesMut::new(bytes);
26463 #[allow(clippy::absurd_extreme_comparisons)]
26464 #[allow(unused_comparisons)]
26465 if __tmp.remaining() < Self::ENCODED_LEN {
26466 panic!(
26467 "buffer is too small (need {} bytes, but got {})",
26468 Self::ENCODED_LEN,
26469 __tmp.remaining(),
26470 )
26471 }
26472 __tmp.put_u32_le(self.time_boot_ms);
26473 __tmp.put_i16_le(self.xacc);
26474 __tmp.put_i16_le(self.yacc);
26475 __tmp.put_i16_le(self.zacc);
26476 __tmp.put_i16_le(self.xgyro);
26477 __tmp.put_i16_le(self.ygyro);
26478 __tmp.put_i16_le(self.zgyro);
26479 __tmp.put_i16_le(self.xmag);
26480 __tmp.put_i16_le(self.ymag);
26481 __tmp.put_i16_le(self.zmag);
26482 if matches!(version, MavlinkVersion::V2) {
26483 __tmp.put_i16_le(self.temperature);
26484 let len = __tmp.len();
26485 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
26486 } else {
26487 __tmp.len()
26488 }
26489 }
26490}
26491#[doc = "The pressure readings for the typical setup of one absolute and differential pressure sensor. The units are as specified in each field."]
26492#[doc = ""]
26493#[doc = "ID: 29"]
26494#[derive(Debug, Clone, PartialEq)]
26495#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
26496#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
26497pub struct SCALED_PRESSURE_DATA {
26498 #[doc = "Timestamp (time since system boot)."]
26499 pub time_boot_ms: u32,
26500 #[doc = "Absolute pressure"]
26501 pub press_abs: f32,
26502 #[doc = "Differential pressure 1"]
26503 pub press_diff: f32,
26504 #[doc = "Absolute pressure temperature"]
26505 pub temperature: i16,
26506 #[doc = "Differential pressure temperature (0, if not available). Report values of 0 (or 1) as 1 cdegC."]
26507 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
26508 pub temperature_press_diff: i16,
26509}
26510impl SCALED_PRESSURE_DATA {
26511 pub const ENCODED_LEN: usize = 16usize;
26512 pub const DEFAULT: Self = Self {
26513 time_boot_ms: 0_u32,
26514 press_abs: 0.0_f32,
26515 press_diff: 0.0_f32,
26516 temperature: 0_i16,
26517 temperature_press_diff: 0_i16,
26518 };
26519 #[cfg(feature = "arbitrary")]
26520 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
26521 use arbitrary::{Arbitrary, Unstructured};
26522 let mut buf = [0u8; 1024];
26523 rng.fill_bytes(&mut buf);
26524 let mut unstructured = Unstructured::new(&buf);
26525 Self::arbitrary(&mut unstructured).unwrap_or_default()
26526 }
26527}
26528impl Default for SCALED_PRESSURE_DATA {
26529 fn default() -> Self {
26530 Self::DEFAULT.clone()
26531 }
26532}
26533impl MessageData for SCALED_PRESSURE_DATA {
26534 type Message = MavMessage;
26535 const ID: u32 = 29u32;
26536 const NAME: &'static str = "SCALED_PRESSURE";
26537 const EXTRA_CRC: u8 = 115u8;
26538 const ENCODED_LEN: usize = 16usize;
26539 fn deser(
26540 _version: MavlinkVersion,
26541 __input: &[u8],
26542 ) -> Result<Self, ::mavlink_core::error::ParserError> {
26543 let avail_len = __input.len();
26544 let mut payload_buf = [0; Self::ENCODED_LEN];
26545 let mut buf = if avail_len < Self::ENCODED_LEN {
26546 payload_buf[0..avail_len].copy_from_slice(__input);
26547 Bytes::new(&payload_buf)
26548 } else {
26549 Bytes::new(__input)
26550 };
26551 let mut __struct = Self::default();
26552 __struct.time_boot_ms = buf.get_u32_le();
26553 __struct.press_abs = buf.get_f32_le();
26554 __struct.press_diff = buf.get_f32_le();
26555 __struct.temperature = buf.get_i16_le();
26556 __struct.temperature_press_diff = buf.get_i16_le();
26557 Ok(__struct)
26558 }
26559 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
26560 let mut __tmp = BytesMut::new(bytes);
26561 #[allow(clippy::absurd_extreme_comparisons)]
26562 #[allow(unused_comparisons)]
26563 if __tmp.remaining() < Self::ENCODED_LEN {
26564 panic!(
26565 "buffer is too small (need {} bytes, but got {})",
26566 Self::ENCODED_LEN,
26567 __tmp.remaining(),
26568 )
26569 }
26570 __tmp.put_u32_le(self.time_boot_ms);
26571 __tmp.put_f32_le(self.press_abs);
26572 __tmp.put_f32_le(self.press_diff);
26573 __tmp.put_i16_le(self.temperature);
26574 if matches!(version, MavlinkVersion::V2) {
26575 __tmp.put_i16_le(self.temperature_press_diff);
26576 let len = __tmp.len();
26577 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
26578 } else {
26579 __tmp.len()
26580 }
26581 }
26582}
26583#[doc = "Barometer readings for 2nd barometer."]
26584#[doc = ""]
26585#[doc = "ID: 137"]
26586#[derive(Debug, Clone, PartialEq)]
26587#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
26588#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
26589pub struct SCALED_PRESSURE2_DATA {
26590 #[doc = "Timestamp (time since system boot)."]
26591 pub time_boot_ms: u32,
26592 #[doc = "Absolute pressure"]
26593 pub press_abs: f32,
26594 #[doc = "Differential pressure"]
26595 pub press_diff: f32,
26596 #[doc = "Absolute pressure temperature"]
26597 pub temperature: i16,
26598 #[doc = "Differential pressure temperature (0, if not available). Report values of 0 (or 1) as 1 cdegC."]
26599 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
26600 pub temperature_press_diff: i16,
26601}
26602impl SCALED_PRESSURE2_DATA {
26603 pub const ENCODED_LEN: usize = 16usize;
26604 pub const DEFAULT: Self = Self {
26605 time_boot_ms: 0_u32,
26606 press_abs: 0.0_f32,
26607 press_diff: 0.0_f32,
26608 temperature: 0_i16,
26609 temperature_press_diff: 0_i16,
26610 };
26611 #[cfg(feature = "arbitrary")]
26612 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
26613 use arbitrary::{Arbitrary, Unstructured};
26614 let mut buf = [0u8; 1024];
26615 rng.fill_bytes(&mut buf);
26616 let mut unstructured = Unstructured::new(&buf);
26617 Self::arbitrary(&mut unstructured).unwrap_or_default()
26618 }
26619}
26620impl Default for SCALED_PRESSURE2_DATA {
26621 fn default() -> Self {
26622 Self::DEFAULT.clone()
26623 }
26624}
26625impl MessageData for SCALED_PRESSURE2_DATA {
26626 type Message = MavMessage;
26627 const ID: u32 = 137u32;
26628 const NAME: &'static str = "SCALED_PRESSURE2";
26629 const EXTRA_CRC: u8 = 195u8;
26630 const ENCODED_LEN: usize = 16usize;
26631 fn deser(
26632 _version: MavlinkVersion,
26633 __input: &[u8],
26634 ) -> Result<Self, ::mavlink_core::error::ParserError> {
26635 let avail_len = __input.len();
26636 let mut payload_buf = [0; Self::ENCODED_LEN];
26637 let mut buf = if avail_len < Self::ENCODED_LEN {
26638 payload_buf[0..avail_len].copy_from_slice(__input);
26639 Bytes::new(&payload_buf)
26640 } else {
26641 Bytes::new(__input)
26642 };
26643 let mut __struct = Self::default();
26644 __struct.time_boot_ms = buf.get_u32_le();
26645 __struct.press_abs = buf.get_f32_le();
26646 __struct.press_diff = buf.get_f32_le();
26647 __struct.temperature = buf.get_i16_le();
26648 __struct.temperature_press_diff = buf.get_i16_le();
26649 Ok(__struct)
26650 }
26651 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
26652 let mut __tmp = BytesMut::new(bytes);
26653 #[allow(clippy::absurd_extreme_comparisons)]
26654 #[allow(unused_comparisons)]
26655 if __tmp.remaining() < Self::ENCODED_LEN {
26656 panic!(
26657 "buffer is too small (need {} bytes, but got {})",
26658 Self::ENCODED_LEN,
26659 __tmp.remaining(),
26660 )
26661 }
26662 __tmp.put_u32_le(self.time_boot_ms);
26663 __tmp.put_f32_le(self.press_abs);
26664 __tmp.put_f32_le(self.press_diff);
26665 __tmp.put_i16_le(self.temperature);
26666 if matches!(version, MavlinkVersion::V2) {
26667 __tmp.put_i16_le(self.temperature_press_diff);
26668 let len = __tmp.len();
26669 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
26670 } else {
26671 __tmp.len()
26672 }
26673 }
26674}
26675#[doc = "Barometer readings for 3rd barometer."]
26676#[doc = ""]
26677#[doc = "ID: 143"]
26678#[derive(Debug, Clone, PartialEq)]
26679#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
26680#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
26681pub struct SCALED_PRESSURE3_DATA {
26682 #[doc = "Timestamp (time since system boot)."]
26683 pub time_boot_ms: u32,
26684 #[doc = "Absolute pressure"]
26685 pub press_abs: f32,
26686 #[doc = "Differential pressure"]
26687 pub press_diff: f32,
26688 #[doc = "Absolute pressure temperature"]
26689 pub temperature: i16,
26690 #[doc = "Differential pressure temperature (0, if not available). Report values of 0 (or 1) as 1 cdegC."]
26691 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
26692 pub temperature_press_diff: i16,
26693}
26694impl SCALED_PRESSURE3_DATA {
26695 pub const ENCODED_LEN: usize = 16usize;
26696 pub const DEFAULT: Self = Self {
26697 time_boot_ms: 0_u32,
26698 press_abs: 0.0_f32,
26699 press_diff: 0.0_f32,
26700 temperature: 0_i16,
26701 temperature_press_diff: 0_i16,
26702 };
26703 #[cfg(feature = "arbitrary")]
26704 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
26705 use arbitrary::{Arbitrary, Unstructured};
26706 let mut buf = [0u8; 1024];
26707 rng.fill_bytes(&mut buf);
26708 let mut unstructured = Unstructured::new(&buf);
26709 Self::arbitrary(&mut unstructured).unwrap_or_default()
26710 }
26711}
26712impl Default for SCALED_PRESSURE3_DATA {
26713 fn default() -> Self {
26714 Self::DEFAULT.clone()
26715 }
26716}
26717impl MessageData for SCALED_PRESSURE3_DATA {
26718 type Message = MavMessage;
26719 const ID: u32 = 143u32;
26720 const NAME: &'static str = "SCALED_PRESSURE3";
26721 const EXTRA_CRC: u8 = 131u8;
26722 const ENCODED_LEN: usize = 16usize;
26723 fn deser(
26724 _version: MavlinkVersion,
26725 __input: &[u8],
26726 ) -> Result<Self, ::mavlink_core::error::ParserError> {
26727 let avail_len = __input.len();
26728 let mut payload_buf = [0; Self::ENCODED_LEN];
26729 let mut buf = if avail_len < Self::ENCODED_LEN {
26730 payload_buf[0..avail_len].copy_from_slice(__input);
26731 Bytes::new(&payload_buf)
26732 } else {
26733 Bytes::new(__input)
26734 };
26735 let mut __struct = Self::default();
26736 __struct.time_boot_ms = buf.get_u32_le();
26737 __struct.press_abs = buf.get_f32_le();
26738 __struct.press_diff = buf.get_f32_le();
26739 __struct.temperature = buf.get_i16_le();
26740 __struct.temperature_press_diff = buf.get_i16_le();
26741 Ok(__struct)
26742 }
26743 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
26744 let mut __tmp = BytesMut::new(bytes);
26745 #[allow(clippy::absurd_extreme_comparisons)]
26746 #[allow(unused_comparisons)]
26747 if __tmp.remaining() < Self::ENCODED_LEN {
26748 panic!(
26749 "buffer is too small (need {} bytes, but got {})",
26750 Self::ENCODED_LEN,
26751 __tmp.remaining(),
26752 )
26753 }
26754 __tmp.put_u32_le(self.time_boot_ms);
26755 __tmp.put_f32_le(self.press_abs);
26756 __tmp.put_f32_le(self.press_diff);
26757 __tmp.put_i16_le(self.temperature);
26758 if matches!(version, MavlinkVersion::V2) {
26759 __tmp.put_i16_le(self.temperature_press_diff);
26760 let len = __tmp.len();
26761 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
26762 } else {
26763 __tmp.len()
26764 }
26765 }
26766}
26767#[doc = "Control a serial port. This can be used for raw access to an onboard serial peripheral such as a GPS or telemetry radio. It is designed to make it possible to update the devices firmware via MAVLink messages or change the devices settings. A message with zero bytes can be used to change just the baudrate."]
26768#[doc = ""]
26769#[doc = "ID: 126"]
26770#[derive(Debug, Clone, PartialEq)]
26771#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
26772#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
26773pub struct SERIAL_CONTROL_DATA {
26774 #[doc = "Baudrate of transfer. Zero means no change."]
26775 pub baudrate: u32,
26776 #[doc = "Timeout for reply data"]
26777 pub timeout: u16,
26778 #[doc = "Serial control device type."]
26779 pub device: SerialControlDev,
26780 #[doc = "Bitmap of serial control flags."]
26781 pub flags: SerialControlFlag,
26782 #[doc = "how many bytes in this transfer"]
26783 pub count: u8,
26784 #[doc = "serial data"]
26785 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
26786 pub data: [u8; 70],
26787 #[doc = "System ID"]
26788 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
26789 pub target_system: u8,
26790 #[doc = "Component ID"]
26791 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
26792 pub target_component: u8,
26793}
26794impl SERIAL_CONTROL_DATA {
26795 pub const ENCODED_LEN: usize = 81usize;
26796 pub const DEFAULT: Self = Self {
26797 baudrate: 0_u32,
26798 timeout: 0_u16,
26799 device: SerialControlDev::DEFAULT,
26800 flags: SerialControlFlag::DEFAULT,
26801 count: 0_u8,
26802 data: [0_u8; 70usize],
26803 target_system: 0_u8,
26804 target_component: 0_u8,
26805 };
26806 #[cfg(feature = "arbitrary")]
26807 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
26808 use arbitrary::{Arbitrary, Unstructured};
26809 let mut buf = [0u8; 1024];
26810 rng.fill_bytes(&mut buf);
26811 let mut unstructured = Unstructured::new(&buf);
26812 Self::arbitrary(&mut unstructured).unwrap_or_default()
26813 }
26814}
26815impl Default for SERIAL_CONTROL_DATA {
26816 fn default() -> Self {
26817 Self::DEFAULT.clone()
26818 }
26819}
26820impl MessageData for SERIAL_CONTROL_DATA {
26821 type Message = MavMessage;
26822 const ID: u32 = 126u32;
26823 const NAME: &'static str = "SERIAL_CONTROL";
26824 const EXTRA_CRC: u8 = 220u8;
26825 const ENCODED_LEN: usize = 81usize;
26826 fn deser(
26827 _version: MavlinkVersion,
26828 __input: &[u8],
26829 ) -> Result<Self, ::mavlink_core::error::ParserError> {
26830 let avail_len = __input.len();
26831 let mut payload_buf = [0; Self::ENCODED_LEN];
26832 let mut buf = if avail_len < Self::ENCODED_LEN {
26833 payload_buf[0..avail_len].copy_from_slice(__input);
26834 Bytes::new(&payload_buf)
26835 } else {
26836 Bytes::new(__input)
26837 };
26838 let mut __struct = Self::default();
26839 __struct.baudrate = buf.get_u32_le();
26840 __struct.timeout = buf.get_u16_le();
26841 let tmp = buf.get_u8();
26842 __struct.device =
26843 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
26844 enum_type: "SerialControlDev",
26845 value: tmp as u32,
26846 })?;
26847 let tmp = buf.get_u8();
26848 __struct.flags = SerialControlFlag::from_bits(tmp & SerialControlFlag::all().bits())
26849 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
26850 flag_type: "SerialControlFlag",
26851 value: tmp as u32,
26852 })?;
26853 __struct.count = buf.get_u8();
26854 for v in &mut __struct.data {
26855 let val = buf.get_u8();
26856 *v = val;
26857 }
26858 __struct.target_system = buf.get_u8();
26859 __struct.target_component = buf.get_u8();
26860 Ok(__struct)
26861 }
26862 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
26863 let mut __tmp = BytesMut::new(bytes);
26864 #[allow(clippy::absurd_extreme_comparisons)]
26865 #[allow(unused_comparisons)]
26866 if __tmp.remaining() < Self::ENCODED_LEN {
26867 panic!(
26868 "buffer is too small (need {} bytes, but got {})",
26869 Self::ENCODED_LEN,
26870 __tmp.remaining(),
26871 )
26872 }
26873 __tmp.put_u32_le(self.baudrate);
26874 __tmp.put_u16_le(self.timeout);
26875 __tmp.put_u8(self.device as u8);
26876 __tmp.put_u8(self.flags.bits());
26877 __tmp.put_u8(self.count);
26878 for val in &self.data {
26879 __tmp.put_u8(*val);
26880 }
26881 if matches!(version, MavlinkVersion::V2) {
26882 __tmp.put_u8(self.target_system);
26883 __tmp.put_u8(self.target_component);
26884 let len = __tmp.len();
26885 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
26886 } else {
26887 __tmp.len()
26888 }
26889 }
26890}
26891#[doc = "Superseded by ACTUATOR_OUTPUT_STATUS. The RAW values of the servo outputs (for RC input from the remote, use the RC_CHANNELS messages). The standard PPM modulation is as follows: 1000 microseconds: 0%, 2000 microseconds: 100%."]
26892#[doc = ""]
26893#[doc = "ID: 36"]
26894#[derive(Debug, Clone, PartialEq)]
26895#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
26896#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
26897pub struct SERVO_OUTPUT_RAW_DATA {
26898 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
26899 pub time_usec: u32,
26900 #[doc = "Servo output 1 value"]
26901 pub servo1_raw: u16,
26902 #[doc = "Servo output 2 value"]
26903 pub servo2_raw: u16,
26904 #[doc = "Servo output 3 value"]
26905 pub servo3_raw: u16,
26906 #[doc = "Servo output 4 value"]
26907 pub servo4_raw: u16,
26908 #[doc = "Servo output 5 value"]
26909 pub servo5_raw: u16,
26910 #[doc = "Servo output 6 value"]
26911 pub servo6_raw: u16,
26912 #[doc = "Servo output 7 value"]
26913 pub servo7_raw: u16,
26914 #[doc = "Servo output 8 value"]
26915 pub servo8_raw: u16,
26916 #[doc = "Servo output port (set of 8 outputs = 1 port). Flight stacks running on Pixhawk should use: 0 = MAIN, 1 = AUX."]
26917 pub port: u8,
26918 #[doc = "Servo output 9 value"]
26919 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
26920 pub servo9_raw: u16,
26921 #[doc = "Servo output 10 value"]
26922 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
26923 pub servo10_raw: u16,
26924 #[doc = "Servo output 11 value"]
26925 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
26926 pub servo11_raw: u16,
26927 #[doc = "Servo output 12 value"]
26928 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
26929 pub servo12_raw: u16,
26930 #[doc = "Servo output 13 value"]
26931 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
26932 pub servo13_raw: u16,
26933 #[doc = "Servo output 14 value"]
26934 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
26935 pub servo14_raw: u16,
26936 #[doc = "Servo output 15 value"]
26937 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
26938 pub servo15_raw: u16,
26939 #[doc = "Servo output 16 value"]
26940 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
26941 pub servo16_raw: u16,
26942}
26943impl SERVO_OUTPUT_RAW_DATA {
26944 pub const ENCODED_LEN: usize = 37usize;
26945 pub const DEFAULT: Self = Self {
26946 time_usec: 0_u32,
26947 servo1_raw: 0_u16,
26948 servo2_raw: 0_u16,
26949 servo3_raw: 0_u16,
26950 servo4_raw: 0_u16,
26951 servo5_raw: 0_u16,
26952 servo6_raw: 0_u16,
26953 servo7_raw: 0_u16,
26954 servo8_raw: 0_u16,
26955 port: 0_u8,
26956 servo9_raw: 0_u16,
26957 servo10_raw: 0_u16,
26958 servo11_raw: 0_u16,
26959 servo12_raw: 0_u16,
26960 servo13_raw: 0_u16,
26961 servo14_raw: 0_u16,
26962 servo15_raw: 0_u16,
26963 servo16_raw: 0_u16,
26964 };
26965 #[cfg(feature = "arbitrary")]
26966 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
26967 use arbitrary::{Arbitrary, Unstructured};
26968 let mut buf = [0u8; 1024];
26969 rng.fill_bytes(&mut buf);
26970 let mut unstructured = Unstructured::new(&buf);
26971 Self::arbitrary(&mut unstructured).unwrap_or_default()
26972 }
26973}
26974impl Default for SERVO_OUTPUT_RAW_DATA {
26975 fn default() -> Self {
26976 Self::DEFAULT.clone()
26977 }
26978}
26979impl MessageData for SERVO_OUTPUT_RAW_DATA {
26980 type Message = MavMessage;
26981 const ID: u32 = 36u32;
26982 const NAME: &'static str = "SERVO_OUTPUT_RAW";
26983 const EXTRA_CRC: u8 = 222u8;
26984 const ENCODED_LEN: usize = 37usize;
26985 fn deser(
26986 _version: MavlinkVersion,
26987 __input: &[u8],
26988 ) -> Result<Self, ::mavlink_core::error::ParserError> {
26989 let avail_len = __input.len();
26990 let mut payload_buf = [0; Self::ENCODED_LEN];
26991 let mut buf = if avail_len < Self::ENCODED_LEN {
26992 payload_buf[0..avail_len].copy_from_slice(__input);
26993 Bytes::new(&payload_buf)
26994 } else {
26995 Bytes::new(__input)
26996 };
26997 let mut __struct = Self::default();
26998 __struct.time_usec = buf.get_u32_le();
26999 __struct.servo1_raw = buf.get_u16_le();
27000 __struct.servo2_raw = buf.get_u16_le();
27001 __struct.servo3_raw = buf.get_u16_le();
27002 __struct.servo4_raw = buf.get_u16_le();
27003 __struct.servo5_raw = buf.get_u16_le();
27004 __struct.servo6_raw = buf.get_u16_le();
27005 __struct.servo7_raw = buf.get_u16_le();
27006 __struct.servo8_raw = buf.get_u16_le();
27007 __struct.port = buf.get_u8();
27008 __struct.servo9_raw = buf.get_u16_le();
27009 __struct.servo10_raw = buf.get_u16_le();
27010 __struct.servo11_raw = buf.get_u16_le();
27011 __struct.servo12_raw = buf.get_u16_le();
27012 __struct.servo13_raw = buf.get_u16_le();
27013 __struct.servo14_raw = buf.get_u16_le();
27014 __struct.servo15_raw = buf.get_u16_le();
27015 __struct.servo16_raw = buf.get_u16_le();
27016 Ok(__struct)
27017 }
27018 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
27019 let mut __tmp = BytesMut::new(bytes);
27020 #[allow(clippy::absurd_extreme_comparisons)]
27021 #[allow(unused_comparisons)]
27022 if __tmp.remaining() < Self::ENCODED_LEN {
27023 panic!(
27024 "buffer is too small (need {} bytes, but got {})",
27025 Self::ENCODED_LEN,
27026 __tmp.remaining(),
27027 )
27028 }
27029 __tmp.put_u32_le(self.time_usec);
27030 __tmp.put_u16_le(self.servo1_raw);
27031 __tmp.put_u16_le(self.servo2_raw);
27032 __tmp.put_u16_le(self.servo3_raw);
27033 __tmp.put_u16_le(self.servo4_raw);
27034 __tmp.put_u16_le(self.servo5_raw);
27035 __tmp.put_u16_le(self.servo6_raw);
27036 __tmp.put_u16_le(self.servo7_raw);
27037 __tmp.put_u16_le(self.servo8_raw);
27038 __tmp.put_u8(self.port);
27039 if matches!(version, MavlinkVersion::V2) {
27040 __tmp.put_u16_le(self.servo9_raw);
27041 __tmp.put_u16_le(self.servo10_raw);
27042 __tmp.put_u16_le(self.servo11_raw);
27043 __tmp.put_u16_le(self.servo12_raw);
27044 __tmp.put_u16_le(self.servo13_raw);
27045 __tmp.put_u16_le(self.servo14_raw);
27046 __tmp.put_u16_le(self.servo15_raw);
27047 __tmp.put_u16_le(self.servo16_raw);
27048 let len = __tmp.len();
27049 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
27050 } else {
27051 __tmp.len()
27052 }
27053 }
27054}
27055#[doc = "Setup a MAVLink2 signing key. If called with secret_key of all zero and zero initial_timestamp will disable signing."]
27056#[doc = ""]
27057#[doc = "ID: 256"]
27058#[derive(Debug, Clone, PartialEq)]
27059#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
27060#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
27061pub struct SETUP_SIGNING_DATA {
27062 #[doc = "initial timestamp"]
27063 pub initial_timestamp: u64,
27064 #[doc = "system id of the target"]
27065 pub target_system: u8,
27066 #[doc = "component ID of the target"]
27067 pub target_component: u8,
27068 #[doc = "signing key"]
27069 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
27070 pub secret_key: [u8; 32],
27071}
27072impl SETUP_SIGNING_DATA {
27073 pub const ENCODED_LEN: usize = 42usize;
27074 pub const DEFAULT: Self = Self {
27075 initial_timestamp: 0_u64,
27076 target_system: 0_u8,
27077 target_component: 0_u8,
27078 secret_key: [0_u8; 32usize],
27079 };
27080 #[cfg(feature = "arbitrary")]
27081 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
27082 use arbitrary::{Arbitrary, Unstructured};
27083 let mut buf = [0u8; 1024];
27084 rng.fill_bytes(&mut buf);
27085 let mut unstructured = Unstructured::new(&buf);
27086 Self::arbitrary(&mut unstructured).unwrap_or_default()
27087 }
27088}
27089impl Default for SETUP_SIGNING_DATA {
27090 fn default() -> Self {
27091 Self::DEFAULT.clone()
27092 }
27093}
27094impl MessageData for SETUP_SIGNING_DATA {
27095 type Message = MavMessage;
27096 const ID: u32 = 256u32;
27097 const NAME: &'static str = "SETUP_SIGNING";
27098 const EXTRA_CRC: u8 = 71u8;
27099 const ENCODED_LEN: usize = 42usize;
27100 fn deser(
27101 _version: MavlinkVersion,
27102 __input: &[u8],
27103 ) -> Result<Self, ::mavlink_core::error::ParserError> {
27104 let avail_len = __input.len();
27105 let mut payload_buf = [0; Self::ENCODED_LEN];
27106 let mut buf = if avail_len < Self::ENCODED_LEN {
27107 payload_buf[0..avail_len].copy_from_slice(__input);
27108 Bytes::new(&payload_buf)
27109 } else {
27110 Bytes::new(__input)
27111 };
27112 let mut __struct = Self::default();
27113 __struct.initial_timestamp = buf.get_u64_le();
27114 __struct.target_system = buf.get_u8();
27115 __struct.target_component = buf.get_u8();
27116 for v in &mut __struct.secret_key {
27117 let val = buf.get_u8();
27118 *v = val;
27119 }
27120 Ok(__struct)
27121 }
27122 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
27123 let mut __tmp = BytesMut::new(bytes);
27124 #[allow(clippy::absurd_extreme_comparisons)]
27125 #[allow(unused_comparisons)]
27126 if __tmp.remaining() < Self::ENCODED_LEN {
27127 panic!(
27128 "buffer is too small (need {} bytes, but got {})",
27129 Self::ENCODED_LEN,
27130 __tmp.remaining(),
27131 )
27132 }
27133 __tmp.put_u64_le(self.initial_timestamp);
27134 __tmp.put_u8(self.target_system);
27135 __tmp.put_u8(self.target_component);
27136 for val in &self.secret_key {
27137 __tmp.put_u8(*val);
27138 }
27139 if matches!(version, MavlinkVersion::V2) {
27140 let len = __tmp.len();
27141 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
27142 } else {
27143 __tmp.len()
27144 }
27145 }
27146}
27147#[doc = "Set the vehicle attitude and body angular rates."]
27148#[doc = ""]
27149#[doc = "ID: 139"]
27150#[derive(Debug, Clone, PartialEq)]
27151#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
27152#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
27153pub struct SET_ACTUATOR_CONTROL_TARGET_DATA {
27154 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
27155 pub time_usec: u64,
27156 #[doc = "Actuator controls. Normed to -1..+1 where 0 is neutral position. Throttle for single rotation direction motors is 0..1, negative range for reverse direction. Standard mapping for attitude controls (group 0): (index 0-7): roll, pitch, yaw, throttle, flaps, spoilers, airbrakes, landing gear. Load a pass-through mixer to repurpose them as generic outputs."]
27157 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
27158 pub controls: [f32; 8],
27159 #[doc = "Actuator group. The \"_mlx\" indicates this is a multi-instance message and a MAVLink parser should use this field to difference between instances."]
27160 pub group_mlx: u8,
27161 #[doc = "System ID"]
27162 pub target_system: u8,
27163 #[doc = "Component ID"]
27164 pub target_component: u8,
27165}
27166impl SET_ACTUATOR_CONTROL_TARGET_DATA {
27167 pub const ENCODED_LEN: usize = 43usize;
27168 pub const DEFAULT: Self = Self {
27169 time_usec: 0_u64,
27170 controls: [0.0_f32; 8usize],
27171 group_mlx: 0_u8,
27172 target_system: 0_u8,
27173 target_component: 0_u8,
27174 };
27175 #[cfg(feature = "arbitrary")]
27176 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
27177 use arbitrary::{Arbitrary, Unstructured};
27178 let mut buf = [0u8; 1024];
27179 rng.fill_bytes(&mut buf);
27180 let mut unstructured = Unstructured::new(&buf);
27181 Self::arbitrary(&mut unstructured).unwrap_or_default()
27182 }
27183}
27184impl Default for SET_ACTUATOR_CONTROL_TARGET_DATA {
27185 fn default() -> Self {
27186 Self::DEFAULT.clone()
27187 }
27188}
27189impl MessageData for SET_ACTUATOR_CONTROL_TARGET_DATA {
27190 type Message = MavMessage;
27191 const ID: u32 = 139u32;
27192 const NAME: &'static str = "SET_ACTUATOR_CONTROL_TARGET";
27193 const EXTRA_CRC: u8 = 168u8;
27194 const ENCODED_LEN: usize = 43usize;
27195 fn deser(
27196 _version: MavlinkVersion,
27197 __input: &[u8],
27198 ) -> Result<Self, ::mavlink_core::error::ParserError> {
27199 let avail_len = __input.len();
27200 let mut payload_buf = [0; Self::ENCODED_LEN];
27201 let mut buf = if avail_len < Self::ENCODED_LEN {
27202 payload_buf[0..avail_len].copy_from_slice(__input);
27203 Bytes::new(&payload_buf)
27204 } else {
27205 Bytes::new(__input)
27206 };
27207 let mut __struct = Self::default();
27208 __struct.time_usec = buf.get_u64_le();
27209 for v in &mut __struct.controls {
27210 let val = buf.get_f32_le();
27211 *v = val;
27212 }
27213 __struct.group_mlx = buf.get_u8();
27214 __struct.target_system = buf.get_u8();
27215 __struct.target_component = buf.get_u8();
27216 Ok(__struct)
27217 }
27218 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
27219 let mut __tmp = BytesMut::new(bytes);
27220 #[allow(clippy::absurd_extreme_comparisons)]
27221 #[allow(unused_comparisons)]
27222 if __tmp.remaining() < Self::ENCODED_LEN {
27223 panic!(
27224 "buffer is too small (need {} bytes, but got {})",
27225 Self::ENCODED_LEN,
27226 __tmp.remaining(),
27227 )
27228 }
27229 __tmp.put_u64_le(self.time_usec);
27230 for val in &self.controls {
27231 __tmp.put_f32_le(*val);
27232 }
27233 __tmp.put_u8(self.group_mlx);
27234 __tmp.put_u8(self.target_system);
27235 __tmp.put_u8(self.target_component);
27236 if matches!(version, MavlinkVersion::V2) {
27237 let len = __tmp.len();
27238 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
27239 } else {
27240 __tmp.len()
27241 }
27242 }
27243}
27244#[doc = "Sets a desired vehicle attitude. Used by an external controller to command the vehicle (manual controller or other system)."]
27245#[doc = ""]
27246#[doc = "ID: 82"]
27247#[derive(Debug, Clone, PartialEq)]
27248#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
27249#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
27250pub struct SET_ATTITUDE_TARGET_DATA {
27251 #[doc = "Timestamp (time since system boot)."]
27252 pub time_boot_ms: u32,
27253 #[doc = "Attitude quaternion (w, x, y, z order, zero-rotation is 1, 0, 0, 0) from MAV_FRAME_LOCAL_NED to MAV_FRAME_BODY_FRD"]
27254 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
27255 pub q: [f32; 4],
27256 #[doc = "Body roll rate"]
27257 pub body_roll_rate: f32,
27258 #[doc = "Body pitch rate"]
27259 pub body_pitch_rate: f32,
27260 #[doc = "Body yaw rate"]
27261 pub body_yaw_rate: f32,
27262 #[doc = "Collective thrust, normalized to 0 .. 1 (-1 .. 1 for vehicles capable of reverse trust)"]
27263 pub thrust: f32,
27264 #[doc = "System ID"]
27265 pub target_system: u8,
27266 #[doc = "Component ID"]
27267 pub target_component: u8,
27268 #[doc = "Bitmap to indicate which dimensions should be ignored by the vehicle."]
27269 pub type_mask: AttitudeTargetTypemask,
27270 #[doc = "3D thrust setpoint in the body NED frame, normalized to -1 .. 1"]
27271 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
27272 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
27273 pub thrust_body: [f32; 3],
27274}
27275impl SET_ATTITUDE_TARGET_DATA {
27276 pub const ENCODED_LEN: usize = 51usize;
27277 pub const DEFAULT: Self = Self {
27278 time_boot_ms: 0_u32,
27279 q: [0.0_f32; 4usize],
27280 body_roll_rate: 0.0_f32,
27281 body_pitch_rate: 0.0_f32,
27282 body_yaw_rate: 0.0_f32,
27283 thrust: 0.0_f32,
27284 target_system: 0_u8,
27285 target_component: 0_u8,
27286 type_mask: AttitudeTargetTypemask::DEFAULT,
27287 thrust_body: [0.0_f32; 3usize],
27288 };
27289 #[cfg(feature = "arbitrary")]
27290 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
27291 use arbitrary::{Arbitrary, Unstructured};
27292 let mut buf = [0u8; 1024];
27293 rng.fill_bytes(&mut buf);
27294 let mut unstructured = Unstructured::new(&buf);
27295 Self::arbitrary(&mut unstructured).unwrap_or_default()
27296 }
27297}
27298impl Default for SET_ATTITUDE_TARGET_DATA {
27299 fn default() -> Self {
27300 Self::DEFAULT.clone()
27301 }
27302}
27303impl MessageData for SET_ATTITUDE_TARGET_DATA {
27304 type Message = MavMessage;
27305 const ID: u32 = 82u32;
27306 const NAME: &'static str = "SET_ATTITUDE_TARGET";
27307 const EXTRA_CRC: u8 = 49u8;
27308 const ENCODED_LEN: usize = 51usize;
27309 fn deser(
27310 _version: MavlinkVersion,
27311 __input: &[u8],
27312 ) -> Result<Self, ::mavlink_core::error::ParserError> {
27313 let avail_len = __input.len();
27314 let mut payload_buf = [0; Self::ENCODED_LEN];
27315 let mut buf = if avail_len < Self::ENCODED_LEN {
27316 payload_buf[0..avail_len].copy_from_slice(__input);
27317 Bytes::new(&payload_buf)
27318 } else {
27319 Bytes::new(__input)
27320 };
27321 let mut __struct = Self::default();
27322 __struct.time_boot_ms = buf.get_u32_le();
27323 for v in &mut __struct.q {
27324 let val = buf.get_f32_le();
27325 *v = val;
27326 }
27327 __struct.body_roll_rate = buf.get_f32_le();
27328 __struct.body_pitch_rate = buf.get_f32_le();
27329 __struct.body_yaw_rate = buf.get_f32_le();
27330 __struct.thrust = buf.get_f32_le();
27331 __struct.target_system = buf.get_u8();
27332 __struct.target_component = buf.get_u8();
27333 let tmp = buf.get_u8();
27334 __struct.type_mask = AttitudeTargetTypemask::from_bits(
27335 tmp & AttitudeTargetTypemask::all().bits(),
27336 )
27337 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
27338 flag_type: "AttitudeTargetTypemask",
27339 value: tmp as u32,
27340 })?;
27341 for v in &mut __struct.thrust_body {
27342 let val = buf.get_f32_le();
27343 *v = val;
27344 }
27345 Ok(__struct)
27346 }
27347 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
27348 let mut __tmp = BytesMut::new(bytes);
27349 #[allow(clippy::absurd_extreme_comparisons)]
27350 #[allow(unused_comparisons)]
27351 if __tmp.remaining() < Self::ENCODED_LEN {
27352 panic!(
27353 "buffer is too small (need {} bytes, but got {})",
27354 Self::ENCODED_LEN,
27355 __tmp.remaining(),
27356 )
27357 }
27358 __tmp.put_u32_le(self.time_boot_ms);
27359 for val in &self.q {
27360 __tmp.put_f32_le(*val);
27361 }
27362 __tmp.put_f32_le(self.body_roll_rate);
27363 __tmp.put_f32_le(self.body_pitch_rate);
27364 __tmp.put_f32_le(self.body_yaw_rate);
27365 __tmp.put_f32_le(self.thrust);
27366 __tmp.put_u8(self.target_system);
27367 __tmp.put_u8(self.target_component);
27368 __tmp.put_u8(self.type_mask.bits());
27369 if matches!(version, MavlinkVersion::V2) {
27370 for val in &self.thrust_body {
27371 __tmp.put_f32_le(*val);
27372 }
27373 let len = __tmp.len();
27374 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
27375 } else {
27376 __tmp.len()
27377 }
27378 }
27379}
27380#[deprecated = " See `MAV_CMD_SET_GLOBAL_ORIGIN` (Deprecated since 2025-04)"]
27381#[doc = "Sets the GPS coordinates of the vehicle local origin (0,0,0) position. Vehicle should emit GPS_GLOBAL_ORIGIN irrespective of whether the origin is changed. This enables transform between the local coordinate frame and the global (GPS) coordinate frame, which may be necessary when (for example) indoor and outdoor settings are connected and the MAV should move from in- to outdoor."]
27382#[doc = ""]
27383#[doc = "ID: 48"]
27384#[derive(Debug, Clone, PartialEq)]
27385#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
27386#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
27387pub struct SET_GPS_GLOBAL_ORIGIN_DATA {
27388 #[doc = "Latitude (WGS84)"]
27389 pub latitude: i32,
27390 #[doc = "Longitude (WGS84)"]
27391 pub longitude: i32,
27392 #[doc = "Altitude (MSL). Positive for up."]
27393 pub altitude: i32,
27394 #[doc = "System ID"]
27395 pub target_system: u8,
27396 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
27397 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
27398 pub time_usec: u64,
27399}
27400impl SET_GPS_GLOBAL_ORIGIN_DATA {
27401 pub const ENCODED_LEN: usize = 21usize;
27402 pub const DEFAULT: Self = Self {
27403 latitude: 0_i32,
27404 longitude: 0_i32,
27405 altitude: 0_i32,
27406 target_system: 0_u8,
27407 time_usec: 0_u64,
27408 };
27409 #[cfg(feature = "arbitrary")]
27410 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
27411 use arbitrary::{Arbitrary, Unstructured};
27412 let mut buf = [0u8; 1024];
27413 rng.fill_bytes(&mut buf);
27414 let mut unstructured = Unstructured::new(&buf);
27415 Self::arbitrary(&mut unstructured).unwrap_or_default()
27416 }
27417}
27418impl Default for SET_GPS_GLOBAL_ORIGIN_DATA {
27419 fn default() -> Self {
27420 Self::DEFAULT.clone()
27421 }
27422}
27423impl MessageData for SET_GPS_GLOBAL_ORIGIN_DATA {
27424 type Message = MavMessage;
27425 const ID: u32 = 48u32;
27426 const NAME: &'static str = "SET_GPS_GLOBAL_ORIGIN";
27427 const EXTRA_CRC: u8 = 41u8;
27428 const ENCODED_LEN: usize = 21usize;
27429 fn deser(
27430 _version: MavlinkVersion,
27431 __input: &[u8],
27432 ) -> Result<Self, ::mavlink_core::error::ParserError> {
27433 let avail_len = __input.len();
27434 let mut payload_buf = [0; Self::ENCODED_LEN];
27435 let mut buf = if avail_len < Self::ENCODED_LEN {
27436 payload_buf[0..avail_len].copy_from_slice(__input);
27437 Bytes::new(&payload_buf)
27438 } else {
27439 Bytes::new(__input)
27440 };
27441 let mut __struct = Self::default();
27442 __struct.latitude = buf.get_i32_le();
27443 __struct.longitude = buf.get_i32_le();
27444 __struct.altitude = buf.get_i32_le();
27445 __struct.target_system = buf.get_u8();
27446 __struct.time_usec = buf.get_u64_le();
27447 Ok(__struct)
27448 }
27449 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
27450 let mut __tmp = BytesMut::new(bytes);
27451 #[allow(clippy::absurd_extreme_comparisons)]
27452 #[allow(unused_comparisons)]
27453 if __tmp.remaining() < Self::ENCODED_LEN {
27454 panic!(
27455 "buffer is too small (need {} bytes, but got {})",
27456 Self::ENCODED_LEN,
27457 __tmp.remaining(),
27458 )
27459 }
27460 __tmp.put_i32_le(self.latitude);
27461 __tmp.put_i32_le(self.longitude);
27462 __tmp.put_i32_le(self.altitude);
27463 __tmp.put_u8(self.target_system);
27464 if matches!(version, MavlinkVersion::V2) {
27465 __tmp.put_u64_le(self.time_usec);
27466 let len = __tmp.len();
27467 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
27468 } else {
27469 __tmp.len()
27470 }
27471 }
27472}
27473#[deprecated = "The command protocol version (MAV_CMD_DO_SET_HOME) allows a GCS to detect when setting the home position has failed. See `MAV_CMD_DO_SET_HOME` (Deprecated since 2022-02)"]
27474#[doc = "Sets the home position. \tThe home position is the default position that the system will return to and land on. The position is set automatically by the system during the takeoff (and may also be set using this message). The global and local positions encode the position in the respective coordinate frames, while the q parameter encodes the orientation of the surface. Under normal conditions it describes the heading and terrain slope, which can be used by the aircraft to adjust the approach. The approach 3D vector describes the point to which the system should fly in normal flight mode and then perform a landing sequence along the vector. Note: the current home position may be emitted in a HOME_POSITION message on request (using MAV_CMD_REQUEST_MESSAGE with param1=242)."]
27475#[doc = ""]
27476#[doc = "ID: 243"]
27477#[derive(Debug, Clone, PartialEq)]
27478#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
27479#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
27480pub struct SET_HOME_POSITION_DATA {
27481 #[doc = "Latitude (WGS84)"]
27482 pub latitude: i32,
27483 #[doc = "Longitude (WGS84)"]
27484 pub longitude: i32,
27485 #[doc = "Altitude (MSL). Positive for up."]
27486 pub altitude: i32,
27487 #[doc = "Local X position of this position in the local coordinate frame (NED)"]
27488 pub x: f32,
27489 #[doc = "Local Y position of this position in the local coordinate frame (NED)"]
27490 pub y: f32,
27491 #[doc = "Local Z position of this position in the local coordinate frame (NED: positive \"down\")"]
27492 pub z: f32,
27493 #[doc = "World to surface normal and heading transformation of the takeoff position. Used to indicate the heading and slope of the ground"]
27494 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
27495 pub q: [f32; 4],
27496 #[doc = "Local X position of the end of the approach vector. Multicopters should set this position based on their takeoff path. Grass-landing fixed wing aircraft should set it the same way as multicopters. Runway-landing fixed wing aircraft should set it to the opposite direction of the takeoff, assuming the takeoff happened from the threshold / touchdown zone."]
27497 pub approach_x: f32,
27498 #[doc = "Local Y position of the end of the approach vector. Multicopters should set this position based on their takeoff path. Grass-landing fixed wing aircraft should set it the same way as multicopters. Runway-landing fixed wing aircraft should set it to the opposite direction of the takeoff, assuming the takeoff happened from the threshold / touchdown zone."]
27499 pub approach_y: f32,
27500 #[doc = "Local Z position of the end of the approach vector. Multicopters should set this position based on their takeoff path. Grass-landing fixed wing aircraft should set it the same way as multicopters. Runway-landing fixed wing aircraft should set it to the opposite direction of the takeoff, assuming the takeoff happened from the threshold / touchdown zone."]
27501 pub approach_z: f32,
27502 #[doc = "System ID."]
27503 pub target_system: u8,
27504 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
27505 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
27506 pub time_usec: u64,
27507}
27508impl SET_HOME_POSITION_DATA {
27509 pub const ENCODED_LEN: usize = 61usize;
27510 pub const DEFAULT: Self = Self {
27511 latitude: 0_i32,
27512 longitude: 0_i32,
27513 altitude: 0_i32,
27514 x: 0.0_f32,
27515 y: 0.0_f32,
27516 z: 0.0_f32,
27517 q: [0.0_f32; 4usize],
27518 approach_x: 0.0_f32,
27519 approach_y: 0.0_f32,
27520 approach_z: 0.0_f32,
27521 target_system: 0_u8,
27522 time_usec: 0_u64,
27523 };
27524 #[cfg(feature = "arbitrary")]
27525 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
27526 use arbitrary::{Arbitrary, Unstructured};
27527 let mut buf = [0u8; 1024];
27528 rng.fill_bytes(&mut buf);
27529 let mut unstructured = Unstructured::new(&buf);
27530 Self::arbitrary(&mut unstructured).unwrap_or_default()
27531 }
27532}
27533impl Default for SET_HOME_POSITION_DATA {
27534 fn default() -> Self {
27535 Self::DEFAULT.clone()
27536 }
27537}
27538impl MessageData for SET_HOME_POSITION_DATA {
27539 type Message = MavMessage;
27540 const ID: u32 = 243u32;
27541 const NAME: &'static str = "SET_HOME_POSITION";
27542 const EXTRA_CRC: u8 = 85u8;
27543 const ENCODED_LEN: usize = 61usize;
27544 fn deser(
27545 _version: MavlinkVersion,
27546 __input: &[u8],
27547 ) -> Result<Self, ::mavlink_core::error::ParserError> {
27548 let avail_len = __input.len();
27549 let mut payload_buf = [0; Self::ENCODED_LEN];
27550 let mut buf = if avail_len < Self::ENCODED_LEN {
27551 payload_buf[0..avail_len].copy_from_slice(__input);
27552 Bytes::new(&payload_buf)
27553 } else {
27554 Bytes::new(__input)
27555 };
27556 let mut __struct = Self::default();
27557 __struct.latitude = buf.get_i32_le();
27558 __struct.longitude = buf.get_i32_le();
27559 __struct.altitude = buf.get_i32_le();
27560 __struct.x = buf.get_f32_le();
27561 __struct.y = buf.get_f32_le();
27562 __struct.z = buf.get_f32_le();
27563 for v in &mut __struct.q {
27564 let val = buf.get_f32_le();
27565 *v = val;
27566 }
27567 __struct.approach_x = buf.get_f32_le();
27568 __struct.approach_y = buf.get_f32_le();
27569 __struct.approach_z = buf.get_f32_le();
27570 __struct.target_system = buf.get_u8();
27571 __struct.time_usec = buf.get_u64_le();
27572 Ok(__struct)
27573 }
27574 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
27575 let mut __tmp = BytesMut::new(bytes);
27576 #[allow(clippy::absurd_extreme_comparisons)]
27577 #[allow(unused_comparisons)]
27578 if __tmp.remaining() < Self::ENCODED_LEN {
27579 panic!(
27580 "buffer is too small (need {} bytes, but got {})",
27581 Self::ENCODED_LEN,
27582 __tmp.remaining(),
27583 )
27584 }
27585 __tmp.put_i32_le(self.latitude);
27586 __tmp.put_i32_le(self.longitude);
27587 __tmp.put_i32_le(self.altitude);
27588 __tmp.put_f32_le(self.x);
27589 __tmp.put_f32_le(self.y);
27590 __tmp.put_f32_le(self.z);
27591 for val in &self.q {
27592 __tmp.put_f32_le(*val);
27593 }
27594 __tmp.put_f32_le(self.approach_x);
27595 __tmp.put_f32_le(self.approach_y);
27596 __tmp.put_f32_le(self.approach_z);
27597 __tmp.put_u8(self.target_system);
27598 if matches!(version, MavlinkVersion::V2) {
27599 __tmp.put_u64_le(self.time_usec);
27600 let len = __tmp.len();
27601 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
27602 } else {
27603 __tmp.len()
27604 }
27605 }
27606}
27607#[deprecated = "Use COMMAND_LONG with MAV_CMD_DO_SET_MODE instead. See `MAV_CMD_DO_SET_MODE` (Deprecated since 2015-12)"]
27608#[doc = "Set the system mode, as defined by enum MAV_MODE. There is no target component id as the mode is by definition for the overall aircraft, not only for one component."]
27609#[doc = ""]
27610#[doc = "ID: 11"]
27611#[derive(Debug, Clone, PartialEq)]
27612#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
27613#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
27614pub struct SET_MODE_DATA {
27615 #[doc = "The new autopilot-specific mode. This field can be ignored by an autopilot."]
27616 pub custom_mode: u32,
27617 #[doc = "The system setting the mode"]
27618 pub target_system: u8,
27619 #[doc = "The new base mode."]
27620 pub base_mode: MavMode,
27621}
27622impl SET_MODE_DATA {
27623 pub const ENCODED_LEN: usize = 6usize;
27624 pub const DEFAULT: Self = Self {
27625 custom_mode: 0_u32,
27626 target_system: 0_u8,
27627 base_mode: MavMode::DEFAULT,
27628 };
27629 #[cfg(feature = "arbitrary")]
27630 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
27631 use arbitrary::{Arbitrary, Unstructured};
27632 let mut buf = [0u8; 1024];
27633 rng.fill_bytes(&mut buf);
27634 let mut unstructured = Unstructured::new(&buf);
27635 Self::arbitrary(&mut unstructured).unwrap_or_default()
27636 }
27637}
27638impl Default for SET_MODE_DATA {
27639 fn default() -> Self {
27640 Self::DEFAULT.clone()
27641 }
27642}
27643impl MessageData for SET_MODE_DATA {
27644 type Message = MavMessage;
27645 const ID: u32 = 11u32;
27646 const NAME: &'static str = "SET_MODE";
27647 const EXTRA_CRC: u8 = 89u8;
27648 const ENCODED_LEN: usize = 6usize;
27649 fn deser(
27650 _version: MavlinkVersion,
27651 __input: &[u8],
27652 ) -> Result<Self, ::mavlink_core::error::ParserError> {
27653 let avail_len = __input.len();
27654 let mut payload_buf = [0; Self::ENCODED_LEN];
27655 let mut buf = if avail_len < Self::ENCODED_LEN {
27656 payload_buf[0..avail_len].copy_from_slice(__input);
27657 Bytes::new(&payload_buf)
27658 } else {
27659 Bytes::new(__input)
27660 };
27661 let mut __struct = Self::default();
27662 __struct.custom_mode = buf.get_u32_le();
27663 __struct.target_system = buf.get_u8();
27664 let tmp = buf.get_u8();
27665 __struct.base_mode =
27666 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
27667 enum_type: "MavMode",
27668 value: tmp as u32,
27669 })?;
27670 Ok(__struct)
27671 }
27672 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
27673 let mut __tmp = BytesMut::new(bytes);
27674 #[allow(clippy::absurd_extreme_comparisons)]
27675 #[allow(unused_comparisons)]
27676 if __tmp.remaining() < Self::ENCODED_LEN {
27677 panic!(
27678 "buffer is too small (need {} bytes, but got {})",
27679 Self::ENCODED_LEN,
27680 __tmp.remaining(),
27681 )
27682 }
27683 __tmp.put_u32_le(self.custom_mode);
27684 __tmp.put_u8(self.target_system);
27685 __tmp.put_u8(self.base_mode as u8);
27686 if matches!(version, MavlinkVersion::V2) {
27687 let len = __tmp.len();
27688 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
27689 } else {
27690 __tmp.len()
27691 }
27692 }
27693}
27694#[doc = "Sets a desired vehicle position, velocity, and/or acceleration in a global coordinate system (WGS84). Used by an external controller to command the vehicle (manual controller or other system)."]
27695#[doc = ""]
27696#[doc = "ID: 86"]
27697#[derive(Debug, Clone, PartialEq)]
27698#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
27699#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
27700pub struct SET_POSITION_TARGET_GLOBAL_INT_DATA {
27701 #[doc = "Timestamp (time since system boot). The rationale for the timestamp in the setpoint is to allow the system to compensate for the transport delay of the setpoint. This allows the system to compensate processing latency."]
27702 pub time_boot_ms: u32,
27703 #[doc = "Latitude in WGS84 frame"]
27704 pub lat_int: i32,
27705 #[doc = "Longitude in WGS84 frame"]
27706 pub lon_int: i32,
27707 #[doc = "Altitude (MSL, Relative to home, or AGL - depending on frame)"]
27708 pub alt: f32,
27709 #[doc = "X velocity in NED frame"]
27710 pub vx: f32,
27711 #[doc = "Y velocity in NED frame"]
27712 pub vy: f32,
27713 #[doc = "Z velocity in NED frame"]
27714 pub vz: f32,
27715 #[doc = "X acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N"]
27716 pub afx: f32,
27717 #[doc = "Y acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N"]
27718 pub afy: f32,
27719 #[doc = "Z acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N"]
27720 pub afz: f32,
27721 #[doc = "yaw setpoint"]
27722 pub yaw: f32,
27723 #[doc = "yaw rate setpoint"]
27724 pub yaw_rate: f32,
27725 #[doc = "Bitmap to indicate which dimensions should be ignored by the vehicle."]
27726 pub type_mask: PositionTargetTypemask,
27727 #[doc = "System ID"]
27728 pub target_system: u8,
27729 #[doc = "Component ID"]
27730 pub target_component: u8,
27731 #[doc = "Valid options are: MAV_FRAME_GLOBAL = 0, MAV_FRAME_GLOBAL_RELATIVE_ALT = 3, MAV_FRAME_GLOBAL_TERRAIN_ALT = 10 (MAV_FRAME_GLOBAL_INT, MAV_FRAME_GLOBAL_RELATIVE_ALT_INT, MAV_FRAME_GLOBAL_TERRAIN_ALT_INT are allowed synonyms, but have been deprecated)"]
27732 pub coordinate_frame: MavFrame,
27733}
27734impl SET_POSITION_TARGET_GLOBAL_INT_DATA {
27735 pub const ENCODED_LEN: usize = 53usize;
27736 pub const DEFAULT: Self = Self {
27737 time_boot_ms: 0_u32,
27738 lat_int: 0_i32,
27739 lon_int: 0_i32,
27740 alt: 0.0_f32,
27741 vx: 0.0_f32,
27742 vy: 0.0_f32,
27743 vz: 0.0_f32,
27744 afx: 0.0_f32,
27745 afy: 0.0_f32,
27746 afz: 0.0_f32,
27747 yaw: 0.0_f32,
27748 yaw_rate: 0.0_f32,
27749 type_mask: PositionTargetTypemask::DEFAULT,
27750 target_system: 0_u8,
27751 target_component: 0_u8,
27752 coordinate_frame: MavFrame::DEFAULT,
27753 };
27754 #[cfg(feature = "arbitrary")]
27755 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
27756 use arbitrary::{Arbitrary, Unstructured};
27757 let mut buf = [0u8; 1024];
27758 rng.fill_bytes(&mut buf);
27759 let mut unstructured = Unstructured::new(&buf);
27760 Self::arbitrary(&mut unstructured).unwrap_or_default()
27761 }
27762}
27763impl Default for SET_POSITION_TARGET_GLOBAL_INT_DATA {
27764 fn default() -> Self {
27765 Self::DEFAULT.clone()
27766 }
27767}
27768impl MessageData for SET_POSITION_TARGET_GLOBAL_INT_DATA {
27769 type Message = MavMessage;
27770 const ID: u32 = 86u32;
27771 const NAME: &'static str = "SET_POSITION_TARGET_GLOBAL_INT";
27772 const EXTRA_CRC: u8 = 5u8;
27773 const ENCODED_LEN: usize = 53usize;
27774 fn deser(
27775 _version: MavlinkVersion,
27776 __input: &[u8],
27777 ) -> Result<Self, ::mavlink_core::error::ParserError> {
27778 let avail_len = __input.len();
27779 let mut payload_buf = [0; Self::ENCODED_LEN];
27780 let mut buf = if avail_len < Self::ENCODED_LEN {
27781 payload_buf[0..avail_len].copy_from_slice(__input);
27782 Bytes::new(&payload_buf)
27783 } else {
27784 Bytes::new(__input)
27785 };
27786 let mut __struct = Self::default();
27787 __struct.time_boot_ms = buf.get_u32_le();
27788 __struct.lat_int = buf.get_i32_le();
27789 __struct.lon_int = buf.get_i32_le();
27790 __struct.alt = buf.get_f32_le();
27791 __struct.vx = buf.get_f32_le();
27792 __struct.vy = buf.get_f32_le();
27793 __struct.vz = buf.get_f32_le();
27794 __struct.afx = buf.get_f32_le();
27795 __struct.afy = buf.get_f32_le();
27796 __struct.afz = buf.get_f32_le();
27797 __struct.yaw = buf.get_f32_le();
27798 __struct.yaw_rate = buf.get_f32_le();
27799 let tmp = buf.get_u16_le();
27800 __struct.type_mask = PositionTargetTypemask::from_bits(
27801 tmp & PositionTargetTypemask::all().bits(),
27802 )
27803 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
27804 flag_type: "PositionTargetTypemask",
27805 value: tmp as u32,
27806 })?;
27807 __struct.target_system = buf.get_u8();
27808 __struct.target_component = buf.get_u8();
27809 let tmp = buf.get_u8();
27810 __struct.coordinate_frame =
27811 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
27812 enum_type: "MavFrame",
27813 value: tmp as u32,
27814 })?;
27815 Ok(__struct)
27816 }
27817 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
27818 let mut __tmp = BytesMut::new(bytes);
27819 #[allow(clippy::absurd_extreme_comparisons)]
27820 #[allow(unused_comparisons)]
27821 if __tmp.remaining() < Self::ENCODED_LEN {
27822 panic!(
27823 "buffer is too small (need {} bytes, but got {})",
27824 Self::ENCODED_LEN,
27825 __tmp.remaining(),
27826 )
27827 }
27828 __tmp.put_u32_le(self.time_boot_ms);
27829 __tmp.put_i32_le(self.lat_int);
27830 __tmp.put_i32_le(self.lon_int);
27831 __tmp.put_f32_le(self.alt);
27832 __tmp.put_f32_le(self.vx);
27833 __tmp.put_f32_le(self.vy);
27834 __tmp.put_f32_le(self.vz);
27835 __tmp.put_f32_le(self.afx);
27836 __tmp.put_f32_le(self.afy);
27837 __tmp.put_f32_le(self.afz);
27838 __tmp.put_f32_le(self.yaw);
27839 __tmp.put_f32_le(self.yaw_rate);
27840 __tmp.put_u16_le(self.type_mask.bits());
27841 __tmp.put_u8(self.target_system);
27842 __tmp.put_u8(self.target_component);
27843 __tmp.put_u8(self.coordinate_frame as u8);
27844 if matches!(version, MavlinkVersion::V2) {
27845 let len = __tmp.len();
27846 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
27847 } else {
27848 __tmp.len()
27849 }
27850 }
27851}
27852#[doc = "Sets a desired vehicle position in a local north-east-down coordinate frame. Used by an external controller to command the vehicle (manual controller or other system)."]
27853#[doc = ""]
27854#[doc = "ID: 84"]
27855#[derive(Debug, Clone, PartialEq)]
27856#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
27857#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
27858pub struct SET_POSITION_TARGET_LOCAL_NED_DATA {
27859 #[doc = "Timestamp (time since system boot)."]
27860 pub time_boot_ms: u32,
27861 #[doc = "X Position in NED frame"]
27862 pub x: f32,
27863 #[doc = "Y Position in NED frame"]
27864 pub y: f32,
27865 #[doc = "Z Position in NED frame (note, altitude is negative in NED)"]
27866 pub z: f32,
27867 #[doc = "X velocity in NED frame"]
27868 pub vx: f32,
27869 #[doc = "Y velocity in NED frame"]
27870 pub vy: f32,
27871 #[doc = "Z velocity in NED frame"]
27872 pub vz: f32,
27873 #[doc = "X acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N"]
27874 pub afx: f32,
27875 #[doc = "Y acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N"]
27876 pub afy: f32,
27877 #[doc = "Z acceleration or force (if bit 10 of type_mask is set) in NED frame in meter / s^2 or N"]
27878 pub afz: f32,
27879 #[doc = "yaw setpoint"]
27880 pub yaw: f32,
27881 #[doc = "yaw rate setpoint"]
27882 pub yaw_rate: f32,
27883 #[doc = "Bitmap to indicate which dimensions should be ignored by the vehicle."]
27884 pub type_mask: PositionTargetTypemask,
27885 #[doc = "System ID"]
27886 pub target_system: u8,
27887 #[doc = "Component ID"]
27888 pub target_component: u8,
27889 #[doc = "Valid options are: MAV_FRAME_LOCAL_NED = 1, MAV_FRAME_LOCAL_OFFSET_NED = 7, MAV_FRAME_BODY_NED = 8, MAV_FRAME_BODY_OFFSET_NED = 9"]
27890 pub coordinate_frame: MavFrame,
27891}
27892impl SET_POSITION_TARGET_LOCAL_NED_DATA {
27893 pub const ENCODED_LEN: usize = 53usize;
27894 pub const DEFAULT: Self = Self {
27895 time_boot_ms: 0_u32,
27896 x: 0.0_f32,
27897 y: 0.0_f32,
27898 z: 0.0_f32,
27899 vx: 0.0_f32,
27900 vy: 0.0_f32,
27901 vz: 0.0_f32,
27902 afx: 0.0_f32,
27903 afy: 0.0_f32,
27904 afz: 0.0_f32,
27905 yaw: 0.0_f32,
27906 yaw_rate: 0.0_f32,
27907 type_mask: PositionTargetTypemask::DEFAULT,
27908 target_system: 0_u8,
27909 target_component: 0_u8,
27910 coordinate_frame: MavFrame::DEFAULT,
27911 };
27912 #[cfg(feature = "arbitrary")]
27913 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
27914 use arbitrary::{Arbitrary, Unstructured};
27915 let mut buf = [0u8; 1024];
27916 rng.fill_bytes(&mut buf);
27917 let mut unstructured = Unstructured::new(&buf);
27918 Self::arbitrary(&mut unstructured).unwrap_or_default()
27919 }
27920}
27921impl Default for SET_POSITION_TARGET_LOCAL_NED_DATA {
27922 fn default() -> Self {
27923 Self::DEFAULT.clone()
27924 }
27925}
27926impl MessageData for SET_POSITION_TARGET_LOCAL_NED_DATA {
27927 type Message = MavMessage;
27928 const ID: u32 = 84u32;
27929 const NAME: &'static str = "SET_POSITION_TARGET_LOCAL_NED";
27930 const EXTRA_CRC: u8 = 143u8;
27931 const ENCODED_LEN: usize = 53usize;
27932 fn deser(
27933 _version: MavlinkVersion,
27934 __input: &[u8],
27935 ) -> Result<Self, ::mavlink_core::error::ParserError> {
27936 let avail_len = __input.len();
27937 let mut payload_buf = [0; Self::ENCODED_LEN];
27938 let mut buf = if avail_len < Self::ENCODED_LEN {
27939 payload_buf[0..avail_len].copy_from_slice(__input);
27940 Bytes::new(&payload_buf)
27941 } else {
27942 Bytes::new(__input)
27943 };
27944 let mut __struct = Self::default();
27945 __struct.time_boot_ms = buf.get_u32_le();
27946 __struct.x = buf.get_f32_le();
27947 __struct.y = buf.get_f32_le();
27948 __struct.z = buf.get_f32_le();
27949 __struct.vx = buf.get_f32_le();
27950 __struct.vy = buf.get_f32_le();
27951 __struct.vz = buf.get_f32_le();
27952 __struct.afx = buf.get_f32_le();
27953 __struct.afy = buf.get_f32_le();
27954 __struct.afz = buf.get_f32_le();
27955 __struct.yaw = buf.get_f32_le();
27956 __struct.yaw_rate = buf.get_f32_le();
27957 let tmp = buf.get_u16_le();
27958 __struct.type_mask = PositionTargetTypemask::from_bits(
27959 tmp & PositionTargetTypemask::all().bits(),
27960 )
27961 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
27962 flag_type: "PositionTargetTypemask",
27963 value: tmp as u32,
27964 })?;
27965 __struct.target_system = buf.get_u8();
27966 __struct.target_component = buf.get_u8();
27967 let tmp = buf.get_u8();
27968 __struct.coordinate_frame =
27969 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
27970 enum_type: "MavFrame",
27971 value: tmp as u32,
27972 })?;
27973 Ok(__struct)
27974 }
27975 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
27976 let mut __tmp = BytesMut::new(bytes);
27977 #[allow(clippy::absurd_extreme_comparisons)]
27978 #[allow(unused_comparisons)]
27979 if __tmp.remaining() < Self::ENCODED_LEN {
27980 panic!(
27981 "buffer is too small (need {} bytes, but got {})",
27982 Self::ENCODED_LEN,
27983 __tmp.remaining(),
27984 )
27985 }
27986 __tmp.put_u32_le(self.time_boot_ms);
27987 __tmp.put_f32_le(self.x);
27988 __tmp.put_f32_le(self.y);
27989 __tmp.put_f32_le(self.z);
27990 __tmp.put_f32_le(self.vx);
27991 __tmp.put_f32_le(self.vy);
27992 __tmp.put_f32_le(self.vz);
27993 __tmp.put_f32_le(self.afx);
27994 __tmp.put_f32_le(self.afy);
27995 __tmp.put_f32_le(self.afz);
27996 __tmp.put_f32_le(self.yaw);
27997 __tmp.put_f32_le(self.yaw_rate);
27998 __tmp.put_u16_le(self.type_mask.bits());
27999 __tmp.put_u8(self.target_system);
28000 __tmp.put_u8(self.target_component);
28001 __tmp.put_u8(self.coordinate_frame as u8);
28002 if matches!(version, MavlinkVersion::V2) {
28003 let len = __tmp.len();
28004 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
28005 } else {
28006 __tmp.len()
28007 }
28008 }
28009}
28010#[doc = "Status of simulation environment, if used."]
28011#[doc = ""]
28012#[doc = "ID: 108"]
28013#[derive(Debug, Clone, PartialEq)]
28014#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
28015#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
28016pub struct SIM_STATE_DATA {
28017 #[doc = "True attitude quaternion component 1, w (1 in null-rotation)"]
28018 pub q1: f32,
28019 #[doc = "True attitude quaternion component 2, x (0 in null-rotation)"]
28020 pub q2: f32,
28021 #[doc = "True attitude quaternion component 3, y (0 in null-rotation)"]
28022 pub q3: f32,
28023 #[doc = "True attitude quaternion component 4, z (0 in null-rotation)"]
28024 pub q4: f32,
28025 #[doc = "Attitude roll expressed as Euler angles, not recommended except for human-readable outputs"]
28026 pub roll: f32,
28027 #[doc = "Attitude pitch expressed as Euler angles, not recommended except for human-readable outputs"]
28028 pub pitch: f32,
28029 #[doc = "Attitude yaw expressed as Euler angles, not recommended except for human-readable outputs"]
28030 pub yaw: f32,
28031 #[doc = "X acceleration"]
28032 pub xacc: f32,
28033 #[doc = "Y acceleration"]
28034 pub yacc: f32,
28035 #[doc = "Z acceleration"]
28036 pub zacc: f32,
28037 #[doc = "Angular speed around X axis"]
28038 pub xgyro: f32,
28039 #[doc = "Angular speed around Y axis"]
28040 pub ygyro: f32,
28041 #[doc = "Angular speed around Z axis"]
28042 pub zgyro: f32,
28043 #[doc = "Latitude (lower precision). Both this and the lat_int field should be set."]
28044 pub lat: f32,
28045 #[doc = "Longitude (lower precision). Both this and the lon_int field should be set."]
28046 pub lon: f32,
28047 #[doc = "Altitude"]
28048 pub alt: f32,
28049 #[doc = "Horizontal position standard deviation"]
28050 pub std_dev_horz: f32,
28051 #[doc = "Vertical position standard deviation"]
28052 pub std_dev_vert: f32,
28053 #[doc = "True velocity in north direction in earth-fixed NED frame"]
28054 pub vn: f32,
28055 #[doc = "True velocity in east direction in earth-fixed NED frame"]
28056 pub ve: f32,
28057 #[doc = "True velocity in down direction in earth-fixed NED frame"]
28058 pub vd: f32,
28059 #[doc = "Latitude (higher precision). If 0, recipients should use the lat field value (otherwise this field is preferred)."]
28060 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
28061 pub lat_int: i32,
28062 #[doc = "Longitude (higher precision). If 0, recipients should use the lon field value (otherwise this field is preferred)."]
28063 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
28064 pub lon_int: i32,
28065}
28066impl SIM_STATE_DATA {
28067 pub const ENCODED_LEN: usize = 92usize;
28068 pub const DEFAULT: Self = Self {
28069 q1: 0.0_f32,
28070 q2: 0.0_f32,
28071 q3: 0.0_f32,
28072 q4: 0.0_f32,
28073 roll: 0.0_f32,
28074 pitch: 0.0_f32,
28075 yaw: 0.0_f32,
28076 xacc: 0.0_f32,
28077 yacc: 0.0_f32,
28078 zacc: 0.0_f32,
28079 xgyro: 0.0_f32,
28080 ygyro: 0.0_f32,
28081 zgyro: 0.0_f32,
28082 lat: 0.0_f32,
28083 lon: 0.0_f32,
28084 alt: 0.0_f32,
28085 std_dev_horz: 0.0_f32,
28086 std_dev_vert: 0.0_f32,
28087 vn: 0.0_f32,
28088 ve: 0.0_f32,
28089 vd: 0.0_f32,
28090 lat_int: 0_i32,
28091 lon_int: 0_i32,
28092 };
28093 #[cfg(feature = "arbitrary")]
28094 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
28095 use arbitrary::{Arbitrary, Unstructured};
28096 let mut buf = [0u8; 1024];
28097 rng.fill_bytes(&mut buf);
28098 let mut unstructured = Unstructured::new(&buf);
28099 Self::arbitrary(&mut unstructured).unwrap_or_default()
28100 }
28101}
28102impl Default for SIM_STATE_DATA {
28103 fn default() -> Self {
28104 Self::DEFAULT.clone()
28105 }
28106}
28107impl MessageData for SIM_STATE_DATA {
28108 type Message = MavMessage;
28109 const ID: u32 = 108u32;
28110 const NAME: &'static str = "SIM_STATE";
28111 const EXTRA_CRC: u8 = 32u8;
28112 const ENCODED_LEN: usize = 92usize;
28113 fn deser(
28114 _version: MavlinkVersion,
28115 __input: &[u8],
28116 ) -> Result<Self, ::mavlink_core::error::ParserError> {
28117 let avail_len = __input.len();
28118 let mut payload_buf = [0; Self::ENCODED_LEN];
28119 let mut buf = if avail_len < Self::ENCODED_LEN {
28120 payload_buf[0..avail_len].copy_from_slice(__input);
28121 Bytes::new(&payload_buf)
28122 } else {
28123 Bytes::new(__input)
28124 };
28125 let mut __struct = Self::default();
28126 __struct.q1 = buf.get_f32_le();
28127 __struct.q2 = buf.get_f32_le();
28128 __struct.q3 = buf.get_f32_le();
28129 __struct.q4 = buf.get_f32_le();
28130 __struct.roll = buf.get_f32_le();
28131 __struct.pitch = buf.get_f32_le();
28132 __struct.yaw = buf.get_f32_le();
28133 __struct.xacc = buf.get_f32_le();
28134 __struct.yacc = buf.get_f32_le();
28135 __struct.zacc = buf.get_f32_le();
28136 __struct.xgyro = buf.get_f32_le();
28137 __struct.ygyro = buf.get_f32_le();
28138 __struct.zgyro = buf.get_f32_le();
28139 __struct.lat = buf.get_f32_le();
28140 __struct.lon = buf.get_f32_le();
28141 __struct.alt = buf.get_f32_le();
28142 __struct.std_dev_horz = buf.get_f32_le();
28143 __struct.std_dev_vert = buf.get_f32_le();
28144 __struct.vn = buf.get_f32_le();
28145 __struct.ve = buf.get_f32_le();
28146 __struct.vd = buf.get_f32_le();
28147 __struct.lat_int = buf.get_i32_le();
28148 __struct.lon_int = buf.get_i32_le();
28149 Ok(__struct)
28150 }
28151 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
28152 let mut __tmp = BytesMut::new(bytes);
28153 #[allow(clippy::absurd_extreme_comparisons)]
28154 #[allow(unused_comparisons)]
28155 if __tmp.remaining() < Self::ENCODED_LEN {
28156 panic!(
28157 "buffer is too small (need {} bytes, but got {})",
28158 Self::ENCODED_LEN,
28159 __tmp.remaining(),
28160 )
28161 }
28162 __tmp.put_f32_le(self.q1);
28163 __tmp.put_f32_le(self.q2);
28164 __tmp.put_f32_le(self.q3);
28165 __tmp.put_f32_le(self.q4);
28166 __tmp.put_f32_le(self.roll);
28167 __tmp.put_f32_le(self.pitch);
28168 __tmp.put_f32_le(self.yaw);
28169 __tmp.put_f32_le(self.xacc);
28170 __tmp.put_f32_le(self.yacc);
28171 __tmp.put_f32_le(self.zacc);
28172 __tmp.put_f32_le(self.xgyro);
28173 __tmp.put_f32_le(self.ygyro);
28174 __tmp.put_f32_le(self.zgyro);
28175 __tmp.put_f32_le(self.lat);
28176 __tmp.put_f32_le(self.lon);
28177 __tmp.put_f32_le(self.alt);
28178 __tmp.put_f32_le(self.std_dev_horz);
28179 __tmp.put_f32_le(self.std_dev_vert);
28180 __tmp.put_f32_le(self.vn);
28181 __tmp.put_f32_le(self.ve);
28182 __tmp.put_f32_le(self.vd);
28183 if matches!(version, MavlinkVersion::V2) {
28184 __tmp.put_i32_le(self.lat_int);
28185 __tmp.put_i32_le(self.lon_int);
28186 let len = __tmp.len();
28187 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
28188 } else {
28189 __tmp.len()
28190 }
28191 }
28192}
28193#[deprecated = "The BATTERY_INFO message is better aligned with UAVCAN messages, and in any case is useful even if a battery is not \"smart\". See `BATTERY_INFO` (Deprecated since 2024-02)"]
28194#[doc = "Smart Battery information (static/infrequent update). Use for updates from: smart battery to flight stack, flight stack to GCS. Use BATTERY_STATUS for the frequent battery updates."]
28195#[doc = ""]
28196#[doc = "ID: 370"]
28197#[derive(Debug, Clone, PartialEq)]
28198#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
28199#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
28200pub struct SMART_BATTERY_INFO_DATA {
28201 #[doc = "Capacity when full according to manufacturer, -1: field not provided."]
28202 pub capacity_full_specification: i32,
28203 #[doc = "Capacity when full (accounting for battery degradation), -1: field not provided."]
28204 pub capacity_full: i32,
28205 #[doc = "Charge/discharge cycle count. UINT16_MAX: field not provided."]
28206 pub cycle_count: u16,
28207 #[doc = "Battery weight. 0: field not provided."]
28208 pub weight: u16,
28209 #[doc = "Minimum per-cell voltage when discharging. If not supplied set to UINT16_MAX value."]
28210 pub discharge_minimum_voltage: u16,
28211 #[doc = "Minimum per-cell voltage when charging. If not supplied set to UINT16_MAX value."]
28212 pub charging_minimum_voltage: u16,
28213 #[doc = "Minimum per-cell voltage when resting. If not supplied set to UINT16_MAX value."]
28214 pub resting_minimum_voltage: u16,
28215 #[doc = "Battery ID"]
28216 pub id: u8,
28217 #[doc = "Function of the battery"]
28218 pub battery_function: MavBatteryFunction,
28219 #[doc = "Type (chemistry) of the battery"]
28220 pub mavtype: MavBatteryType,
28221 #[doc = "Serial number in ASCII characters, 0 terminated. All 0: field not provided."]
28222 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
28223 pub serial_number: [u8; 16],
28224 #[doc = "Static device name in ASCII characters, 0 terminated. All 0: field not provided. Encode as manufacturer name then product name separated using an underscore."]
28225 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
28226 pub device_name: [u8; 50],
28227 #[doc = "Maximum per-cell voltage when charged. 0: field not provided."]
28228 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
28229 pub charging_maximum_voltage: u16,
28230 #[doc = "Number of battery cells in series. 0: field not provided."]
28231 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
28232 pub cells_in_series: u8,
28233 #[doc = "Maximum pack discharge current. 0: field not provided."]
28234 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
28235 pub discharge_maximum_current: u32,
28236 #[doc = "Maximum pack discharge burst current. 0: field not provided."]
28237 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
28238 pub discharge_maximum_burst_current: u32,
28239 #[doc = "Manufacture date (DD/MM/YYYY) in ASCII characters, 0 terminated. All 0: field not provided."]
28240 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
28241 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
28242 pub manufacture_date: [u8; 11],
28243}
28244impl SMART_BATTERY_INFO_DATA {
28245 pub const ENCODED_LEN: usize = 109usize;
28246 pub const DEFAULT: Self = Self {
28247 capacity_full_specification: 0_i32,
28248 capacity_full: 0_i32,
28249 cycle_count: 0_u16,
28250 weight: 0_u16,
28251 discharge_minimum_voltage: 0_u16,
28252 charging_minimum_voltage: 0_u16,
28253 resting_minimum_voltage: 0_u16,
28254 id: 0_u8,
28255 battery_function: MavBatteryFunction::DEFAULT,
28256 mavtype: MavBatteryType::DEFAULT,
28257 serial_number: [0_u8; 16usize],
28258 device_name: [0_u8; 50usize],
28259 charging_maximum_voltage: 0_u16,
28260 cells_in_series: 0_u8,
28261 discharge_maximum_current: 0_u32,
28262 discharge_maximum_burst_current: 0_u32,
28263 manufacture_date: [0_u8; 11usize],
28264 };
28265 #[cfg(feature = "arbitrary")]
28266 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
28267 use arbitrary::{Arbitrary, Unstructured};
28268 let mut buf = [0u8; 1024];
28269 rng.fill_bytes(&mut buf);
28270 let mut unstructured = Unstructured::new(&buf);
28271 Self::arbitrary(&mut unstructured).unwrap_or_default()
28272 }
28273}
28274impl Default for SMART_BATTERY_INFO_DATA {
28275 fn default() -> Self {
28276 Self::DEFAULT.clone()
28277 }
28278}
28279impl MessageData for SMART_BATTERY_INFO_DATA {
28280 type Message = MavMessage;
28281 const ID: u32 = 370u32;
28282 const NAME: &'static str = "SMART_BATTERY_INFO";
28283 const EXTRA_CRC: u8 = 75u8;
28284 const ENCODED_LEN: usize = 109usize;
28285 fn deser(
28286 _version: MavlinkVersion,
28287 __input: &[u8],
28288 ) -> Result<Self, ::mavlink_core::error::ParserError> {
28289 let avail_len = __input.len();
28290 let mut payload_buf = [0; Self::ENCODED_LEN];
28291 let mut buf = if avail_len < Self::ENCODED_LEN {
28292 payload_buf[0..avail_len].copy_from_slice(__input);
28293 Bytes::new(&payload_buf)
28294 } else {
28295 Bytes::new(__input)
28296 };
28297 let mut __struct = Self::default();
28298 __struct.capacity_full_specification = buf.get_i32_le();
28299 __struct.capacity_full = buf.get_i32_le();
28300 __struct.cycle_count = buf.get_u16_le();
28301 __struct.weight = buf.get_u16_le();
28302 __struct.discharge_minimum_voltage = buf.get_u16_le();
28303 __struct.charging_minimum_voltage = buf.get_u16_le();
28304 __struct.resting_minimum_voltage = buf.get_u16_le();
28305 __struct.id = buf.get_u8();
28306 let tmp = buf.get_u8();
28307 __struct.battery_function =
28308 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
28309 enum_type: "MavBatteryFunction",
28310 value: tmp as u32,
28311 })?;
28312 let tmp = buf.get_u8();
28313 __struct.mavtype =
28314 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
28315 enum_type: "MavBatteryType",
28316 value: tmp as u32,
28317 })?;
28318 for v in &mut __struct.serial_number {
28319 let val = buf.get_u8();
28320 *v = val;
28321 }
28322 for v in &mut __struct.device_name {
28323 let val = buf.get_u8();
28324 *v = val;
28325 }
28326 __struct.charging_maximum_voltage = buf.get_u16_le();
28327 __struct.cells_in_series = buf.get_u8();
28328 __struct.discharge_maximum_current = buf.get_u32_le();
28329 __struct.discharge_maximum_burst_current = buf.get_u32_le();
28330 for v in &mut __struct.manufacture_date {
28331 let val = buf.get_u8();
28332 *v = val;
28333 }
28334 Ok(__struct)
28335 }
28336 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
28337 let mut __tmp = BytesMut::new(bytes);
28338 #[allow(clippy::absurd_extreme_comparisons)]
28339 #[allow(unused_comparisons)]
28340 if __tmp.remaining() < Self::ENCODED_LEN {
28341 panic!(
28342 "buffer is too small (need {} bytes, but got {})",
28343 Self::ENCODED_LEN,
28344 __tmp.remaining(),
28345 )
28346 }
28347 __tmp.put_i32_le(self.capacity_full_specification);
28348 __tmp.put_i32_le(self.capacity_full);
28349 __tmp.put_u16_le(self.cycle_count);
28350 __tmp.put_u16_le(self.weight);
28351 __tmp.put_u16_le(self.discharge_minimum_voltage);
28352 __tmp.put_u16_le(self.charging_minimum_voltage);
28353 __tmp.put_u16_le(self.resting_minimum_voltage);
28354 __tmp.put_u8(self.id);
28355 __tmp.put_u8(self.battery_function as u8);
28356 __tmp.put_u8(self.mavtype as u8);
28357 for val in &self.serial_number {
28358 __tmp.put_u8(*val);
28359 }
28360 for val in &self.device_name {
28361 __tmp.put_u8(*val);
28362 }
28363 if matches!(version, MavlinkVersion::V2) {
28364 __tmp.put_u16_le(self.charging_maximum_voltage);
28365 __tmp.put_u8(self.cells_in_series);
28366 __tmp.put_u32_le(self.discharge_maximum_current);
28367 __tmp.put_u32_le(self.discharge_maximum_burst_current);
28368 for val in &self.manufacture_date {
28369 __tmp.put_u8(*val);
28370 }
28371 let len = __tmp.len();
28372 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
28373 } else {
28374 __tmp.len()
28375 }
28376 }
28377}
28378#[doc = "Status text message. These messages are printed in yellow in the COMM console of QGroundControl. WARNING: They consume quite some bandwidth, so use only for important status and error messages. If implemented wisely, these messages are buffered on the MCU and sent only at a limited rate (e.g. 10 Hz)."]
28379#[doc = ""]
28380#[doc = "ID: 253"]
28381#[derive(Debug, Clone, PartialEq)]
28382#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
28383#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
28384pub struct STATUSTEXT_DATA {
28385 #[doc = "Severity of status. Relies on the definitions within RFC-5424."]
28386 pub severity: MavSeverity,
28387 #[doc = "Status text message, without null termination character"]
28388 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
28389 pub text: [u8; 50],
28390 #[doc = "Unique (opaque) identifier for this statustext message. May be used to reassemble a logical long-statustext message from a sequence of chunks. A value of zero indicates this is the only chunk in the sequence and the message can be emitted immediately."]
28391 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
28392 pub id: u16,
28393 #[doc = "This chunk's sequence number; indexing is from zero. Any null character in the text field is taken to mean this was the last chunk."]
28394 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
28395 pub chunk_seq: u8,
28396}
28397impl STATUSTEXT_DATA {
28398 pub const ENCODED_LEN: usize = 54usize;
28399 pub const DEFAULT: Self = Self {
28400 severity: MavSeverity::DEFAULT,
28401 text: [0_u8; 50usize],
28402 id: 0_u16,
28403 chunk_seq: 0_u8,
28404 };
28405 #[cfg(feature = "arbitrary")]
28406 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
28407 use arbitrary::{Arbitrary, Unstructured};
28408 let mut buf = [0u8; 1024];
28409 rng.fill_bytes(&mut buf);
28410 let mut unstructured = Unstructured::new(&buf);
28411 Self::arbitrary(&mut unstructured).unwrap_or_default()
28412 }
28413}
28414impl Default for STATUSTEXT_DATA {
28415 fn default() -> Self {
28416 Self::DEFAULT.clone()
28417 }
28418}
28419impl MessageData for STATUSTEXT_DATA {
28420 type Message = MavMessage;
28421 const ID: u32 = 253u32;
28422 const NAME: &'static str = "STATUSTEXT";
28423 const EXTRA_CRC: u8 = 83u8;
28424 const ENCODED_LEN: usize = 54usize;
28425 fn deser(
28426 _version: MavlinkVersion,
28427 __input: &[u8],
28428 ) -> Result<Self, ::mavlink_core::error::ParserError> {
28429 let avail_len = __input.len();
28430 let mut payload_buf = [0; Self::ENCODED_LEN];
28431 let mut buf = if avail_len < Self::ENCODED_LEN {
28432 payload_buf[0..avail_len].copy_from_slice(__input);
28433 Bytes::new(&payload_buf)
28434 } else {
28435 Bytes::new(__input)
28436 };
28437 let mut __struct = Self::default();
28438 let tmp = buf.get_u8();
28439 __struct.severity =
28440 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
28441 enum_type: "MavSeverity",
28442 value: tmp as u32,
28443 })?;
28444 for v in &mut __struct.text {
28445 let val = buf.get_u8();
28446 *v = val;
28447 }
28448 __struct.id = buf.get_u16_le();
28449 __struct.chunk_seq = buf.get_u8();
28450 Ok(__struct)
28451 }
28452 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
28453 let mut __tmp = BytesMut::new(bytes);
28454 #[allow(clippy::absurd_extreme_comparisons)]
28455 #[allow(unused_comparisons)]
28456 if __tmp.remaining() < Self::ENCODED_LEN {
28457 panic!(
28458 "buffer is too small (need {} bytes, but got {})",
28459 Self::ENCODED_LEN,
28460 __tmp.remaining(),
28461 )
28462 }
28463 __tmp.put_u8(self.severity as u8);
28464 for val in &self.text {
28465 __tmp.put_u8(*val);
28466 }
28467 if matches!(version, MavlinkVersion::V2) {
28468 __tmp.put_u16_le(self.id);
28469 __tmp.put_u8(self.chunk_seq);
28470 let len = __tmp.len();
28471 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
28472 } else {
28473 __tmp.len()
28474 }
28475 }
28476}
28477#[doc = "Information about a storage medium. This message is sent in response to a request with MAV_CMD_REQUEST_MESSAGE and whenever the status of the storage changes (STORAGE_STATUS). Use MAV_CMD_REQUEST_MESSAGE.param2 to indicate the index/id of requested storage: 0 for all, 1 for first, 2 for second, etc."]
28478#[doc = ""]
28479#[doc = "ID: 261"]
28480#[derive(Debug, Clone, PartialEq)]
28481#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
28482#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
28483pub struct STORAGE_INFORMATION_DATA {
28484 #[doc = "Timestamp (time since system boot)."]
28485 pub time_boot_ms: u32,
28486 #[doc = "Total capacity. If storage is not ready (STORAGE_STATUS_READY) value will be ignored."]
28487 pub total_capacity: f32,
28488 #[doc = "Used capacity. If storage is not ready (STORAGE_STATUS_READY) value will be ignored."]
28489 pub used_capacity: f32,
28490 #[doc = "Available storage capacity. If storage is not ready (STORAGE_STATUS_READY) value will be ignored."]
28491 pub available_capacity: f32,
28492 #[doc = "Read speed."]
28493 pub read_speed: f32,
28494 #[doc = "Write speed."]
28495 pub write_speed: f32,
28496 #[doc = "Storage ID (1 for first, 2 for second, etc.)"]
28497 pub storage_id: u8,
28498 #[doc = "Number of storage devices"]
28499 pub storage_count: u8,
28500 #[doc = "Status of storage"]
28501 pub status: StorageStatus,
28502 #[doc = "Type of storage"]
28503 #[cfg_attr(feature = "serde", serde(default))]
28504 pub mavtype: StorageType,
28505 #[doc = "Textual storage name to be used in UI (microSD 1, Internal Memory, etc.) This is a NULL terminated string. If it is exactly 32 characters long, add a terminating NULL. If this string is empty, the generic type is shown to the user."]
28506 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
28507 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
28508 pub name: [u8; 32],
28509 #[doc = "Flags indicating whether this instance is preferred storage for photos, videos, etc. Note: Implementations should initially set the flags on the system-default storage id used for saving media (if possible/supported). This setting can then be overridden using MAV_CMD_SET_STORAGE_USAGE. If the media usage flags are not set, a GCS may assume storage ID 1 is the default storage for all media types."]
28510 #[cfg_attr(feature = "serde", serde(default))]
28511 pub storage_usage: StorageUsageFlag,
28512}
28513impl STORAGE_INFORMATION_DATA {
28514 pub const ENCODED_LEN: usize = 61usize;
28515 pub const DEFAULT: Self = Self {
28516 time_boot_ms: 0_u32,
28517 total_capacity: 0.0_f32,
28518 used_capacity: 0.0_f32,
28519 available_capacity: 0.0_f32,
28520 read_speed: 0.0_f32,
28521 write_speed: 0.0_f32,
28522 storage_id: 0_u8,
28523 storage_count: 0_u8,
28524 status: StorageStatus::DEFAULT,
28525 mavtype: StorageType::DEFAULT,
28526 name: [0_u8; 32usize],
28527 storage_usage: StorageUsageFlag::DEFAULT,
28528 };
28529 #[cfg(feature = "arbitrary")]
28530 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
28531 use arbitrary::{Arbitrary, Unstructured};
28532 let mut buf = [0u8; 1024];
28533 rng.fill_bytes(&mut buf);
28534 let mut unstructured = Unstructured::new(&buf);
28535 Self::arbitrary(&mut unstructured).unwrap_or_default()
28536 }
28537}
28538impl Default for STORAGE_INFORMATION_DATA {
28539 fn default() -> Self {
28540 Self::DEFAULT.clone()
28541 }
28542}
28543impl MessageData for STORAGE_INFORMATION_DATA {
28544 type Message = MavMessage;
28545 const ID: u32 = 261u32;
28546 const NAME: &'static str = "STORAGE_INFORMATION";
28547 const EXTRA_CRC: u8 = 179u8;
28548 const ENCODED_LEN: usize = 61usize;
28549 fn deser(
28550 _version: MavlinkVersion,
28551 __input: &[u8],
28552 ) -> Result<Self, ::mavlink_core::error::ParserError> {
28553 let avail_len = __input.len();
28554 let mut payload_buf = [0; Self::ENCODED_LEN];
28555 let mut buf = if avail_len < Self::ENCODED_LEN {
28556 payload_buf[0..avail_len].copy_from_slice(__input);
28557 Bytes::new(&payload_buf)
28558 } else {
28559 Bytes::new(__input)
28560 };
28561 let mut __struct = Self::default();
28562 __struct.time_boot_ms = buf.get_u32_le();
28563 __struct.total_capacity = buf.get_f32_le();
28564 __struct.used_capacity = buf.get_f32_le();
28565 __struct.available_capacity = buf.get_f32_le();
28566 __struct.read_speed = buf.get_f32_le();
28567 __struct.write_speed = buf.get_f32_le();
28568 __struct.storage_id = buf.get_u8();
28569 __struct.storage_count = buf.get_u8();
28570 let tmp = buf.get_u8();
28571 __struct.status =
28572 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
28573 enum_type: "StorageStatus",
28574 value: tmp as u32,
28575 })?;
28576 let tmp = buf.get_u8();
28577 __struct.mavtype =
28578 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
28579 enum_type: "StorageType",
28580 value: tmp as u32,
28581 })?;
28582 for v in &mut __struct.name {
28583 let val = buf.get_u8();
28584 *v = val;
28585 }
28586 let tmp = buf.get_u8();
28587 __struct.storage_usage = StorageUsageFlag::from_bits(tmp & StorageUsageFlag::all().bits())
28588 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
28589 flag_type: "StorageUsageFlag",
28590 value: tmp as u32,
28591 })?;
28592 Ok(__struct)
28593 }
28594 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
28595 let mut __tmp = BytesMut::new(bytes);
28596 #[allow(clippy::absurd_extreme_comparisons)]
28597 #[allow(unused_comparisons)]
28598 if __tmp.remaining() < Self::ENCODED_LEN {
28599 panic!(
28600 "buffer is too small (need {} bytes, but got {})",
28601 Self::ENCODED_LEN,
28602 __tmp.remaining(),
28603 )
28604 }
28605 __tmp.put_u32_le(self.time_boot_ms);
28606 __tmp.put_f32_le(self.total_capacity);
28607 __tmp.put_f32_le(self.used_capacity);
28608 __tmp.put_f32_le(self.available_capacity);
28609 __tmp.put_f32_le(self.read_speed);
28610 __tmp.put_f32_le(self.write_speed);
28611 __tmp.put_u8(self.storage_id);
28612 __tmp.put_u8(self.storage_count);
28613 __tmp.put_u8(self.status as u8);
28614 if matches!(version, MavlinkVersion::V2) {
28615 __tmp.put_u8(self.mavtype as u8);
28616 for val in &self.name {
28617 __tmp.put_u8(*val);
28618 }
28619 __tmp.put_u8(self.storage_usage.bits());
28620 let len = __tmp.len();
28621 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
28622 } else {
28623 __tmp.len()
28624 }
28625 }
28626}
28627#[doc = "Tune formats supported by vehicle. This should be emitted as response to MAV_CMD_REQUEST_MESSAGE."]
28628#[doc = ""]
28629#[doc = "ID: 401"]
28630#[derive(Debug, Clone, PartialEq)]
28631#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
28632#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
28633pub struct SUPPORTED_TUNES_DATA {
28634 #[doc = "Bitfield of supported tune formats."]
28635 pub format: TuneFormat,
28636 #[doc = "System ID"]
28637 pub target_system: u8,
28638 #[doc = "Component ID"]
28639 pub target_component: u8,
28640}
28641impl SUPPORTED_TUNES_DATA {
28642 pub const ENCODED_LEN: usize = 6usize;
28643 pub const DEFAULT: Self = Self {
28644 format: TuneFormat::DEFAULT,
28645 target_system: 0_u8,
28646 target_component: 0_u8,
28647 };
28648 #[cfg(feature = "arbitrary")]
28649 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
28650 use arbitrary::{Arbitrary, Unstructured};
28651 let mut buf = [0u8; 1024];
28652 rng.fill_bytes(&mut buf);
28653 let mut unstructured = Unstructured::new(&buf);
28654 Self::arbitrary(&mut unstructured).unwrap_or_default()
28655 }
28656}
28657impl Default for SUPPORTED_TUNES_DATA {
28658 fn default() -> Self {
28659 Self::DEFAULT.clone()
28660 }
28661}
28662impl MessageData for SUPPORTED_TUNES_DATA {
28663 type Message = MavMessage;
28664 const ID: u32 = 401u32;
28665 const NAME: &'static str = "SUPPORTED_TUNES";
28666 const EXTRA_CRC: u8 = 183u8;
28667 const ENCODED_LEN: usize = 6usize;
28668 fn deser(
28669 _version: MavlinkVersion,
28670 __input: &[u8],
28671 ) -> Result<Self, ::mavlink_core::error::ParserError> {
28672 let avail_len = __input.len();
28673 let mut payload_buf = [0; Self::ENCODED_LEN];
28674 let mut buf = if avail_len < Self::ENCODED_LEN {
28675 payload_buf[0..avail_len].copy_from_slice(__input);
28676 Bytes::new(&payload_buf)
28677 } else {
28678 Bytes::new(__input)
28679 };
28680 let mut __struct = Self::default();
28681 let tmp = buf.get_u32_le();
28682 __struct.format = FromPrimitive::from_u32(tmp).ok_or(
28683 ::mavlink_core::error::ParserError::InvalidEnum {
28684 enum_type: "TuneFormat",
28685 value: tmp as u32,
28686 },
28687 )?;
28688 __struct.target_system = buf.get_u8();
28689 __struct.target_component = buf.get_u8();
28690 Ok(__struct)
28691 }
28692 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
28693 let mut __tmp = BytesMut::new(bytes);
28694 #[allow(clippy::absurd_extreme_comparisons)]
28695 #[allow(unused_comparisons)]
28696 if __tmp.remaining() < Self::ENCODED_LEN {
28697 panic!(
28698 "buffer is too small (need {} bytes, but got {})",
28699 Self::ENCODED_LEN,
28700 __tmp.remaining(),
28701 )
28702 }
28703 __tmp.put_u32_le(self.format as u32);
28704 __tmp.put_u8(self.target_system);
28705 __tmp.put_u8(self.target_component);
28706 if matches!(version, MavlinkVersion::V2) {
28707 let len = __tmp.len();
28708 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
28709 } else {
28710 __tmp.len()
28711 }
28712 }
28713}
28714#[doc = "The system time is the time of the master clock. This can be emitted by flight controllers, onboard computers, or other components in the MAVLink network. Components that are using a less reliable time source, such as a battery-backed real time clock, can choose to match their system clock to that of a SYSTEM_TYPE that indicates a more recent time. This allows more broadly accurate date stamping of logs, and so on. If precise time synchronization is needed then use TIMESYNC instead."]
28715#[doc = ""]
28716#[doc = "ID: 2"]
28717#[derive(Debug, Clone, PartialEq)]
28718#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
28719#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
28720pub struct SYSTEM_TIME_DATA {
28721 #[doc = "Timestamp (UNIX epoch time)."]
28722 pub time_unix_usec: u64,
28723 #[doc = "Timestamp (time since system boot)."]
28724 pub time_boot_ms: u32,
28725}
28726impl SYSTEM_TIME_DATA {
28727 pub const ENCODED_LEN: usize = 12usize;
28728 pub const DEFAULT: Self = Self {
28729 time_unix_usec: 0_u64,
28730 time_boot_ms: 0_u32,
28731 };
28732 #[cfg(feature = "arbitrary")]
28733 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
28734 use arbitrary::{Arbitrary, Unstructured};
28735 let mut buf = [0u8; 1024];
28736 rng.fill_bytes(&mut buf);
28737 let mut unstructured = Unstructured::new(&buf);
28738 Self::arbitrary(&mut unstructured).unwrap_or_default()
28739 }
28740}
28741impl Default for SYSTEM_TIME_DATA {
28742 fn default() -> Self {
28743 Self::DEFAULT.clone()
28744 }
28745}
28746impl MessageData for SYSTEM_TIME_DATA {
28747 type Message = MavMessage;
28748 const ID: u32 = 2u32;
28749 const NAME: &'static str = "SYSTEM_TIME";
28750 const EXTRA_CRC: u8 = 137u8;
28751 const ENCODED_LEN: usize = 12usize;
28752 fn deser(
28753 _version: MavlinkVersion,
28754 __input: &[u8],
28755 ) -> Result<Self, ::mavlink_core::error::ParserError> {
28756 let avail_len = __input.len();
28757 let mut payload_buf = [0; Self::ENCODED_LEN];
28758 let mut buf = if avail_len < Self::ENCODED_LEN {
28759 payload_buf[0..avail_len].copy_from_slice(__input);
28760 Bytes::new(&payload_buf)
28761 } else {
28762 Bytes::new(__input)
28763 };
28764 let mut __struct = Self::default();
28765 __struct.time_unix_usec = buf.get_u64_le();
28766 __struct.time_boot_ms = buf.get_u32_le();
28767 Ok(__struct)
28768 }
28769 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
28770 let mut __tmp = BytesMut::new(bytes);
28771 #[allow(clippy::absurd_extreme_comparisons)]
28772 #[allow(unused_comparisons)]
28773 if __tmp.remaining() < Self::ENCODED_LEN {
28774 panic!(
28775 "buffer is too small (need {} bytes, but got {})",
28776 Self::ENCODED_LEN,
28777 __tmp.remaining(),
28778 )
28779 }
28780 __tmp.put_u64_le(self.time_unix_usec);
28781 __tmp.put_u32_le(self.time_boot_ms);
28782 if matches!(version, MavlinkVersion::V2) {
28783 let len = __tmp.len();
28784 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
28785 } else {
28786 __tmp.len()
28787 }
28788 }
28789}
28790#[doc = "The general system state. If the system is following the MAVLink standard, the system state is mainly defined by three orthogonal states/modes: The system mode, which is either LOCKED (motors shut down and locked), MANUAL (system under RC control), GUIDED (system with autonomous position control, position setpoint controlled manually) or AUTO (system guided by path/waypoint planner). The NAV_MODE defined the current flight state: LIFTOFF (often an open-loop maneuver), LANDING, WAYPOINTS or VECTOR. This represents the internal navigation state machine. The system status shows whether the system is currently active or not and if an emergency occurred. During the CRITICAL and EMERGENCY states the MAV is still considered to be active, but should start emergency procedures autonomously. After a failure occurred it should first move from active to critical to allow manual intervention and then move to emergency after a certain timeout."]
28791#[doc = ""]
28792#[doc = "ID: 1"]
28793#[derive(Debug, Clone, PartialEq)]
28794#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
28795#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
28796pub struct SYS_STATUS_DATA {
28797 #[doc = "Bitmap showing which onboard controllers and sensors are present. Value of 0: not present. Value of 1: present."]
28798 pub onboard_control_sensors_present: MavSysStatusSensor,
28799 #[doc = "Bitmap showing which onboard controllers and sensors are enabled: Value of 0: not enabled. Value of 1: enabled."]
28800 pub onboard_control_sensors_enabled: MavSysStatusSensor,
28801 #[doc = "Bitmap showing which onboard controllers and sensors have an error (or are operational). Value of 0: error. Value of 1: healthy."]
28802 pub onboard_control_sensors_health: MavSysStatusSensor,
28803 #[doc = "Maximum usage in percent of the mainloop time. Values: [0-1000] - should always be below 1000"]
28804 pub load: u16,
28805 #[doc = "Battery voltage, UINT16_MAX: Voltage not sent by autopilot"]
28806 pub voltage_battery: u16,
28807 #[doc = "Battery current, -1: Current not sent by autopilot"]
28808 pub current_battery: i16,
28809 #[doc = "Communication drop rate, (UART, I2C, SPI, CAN), dropped packets on all links (packets that were corrupted on reception on the MAV)"]
28810 pub drop_rate_comm: u16,
28811 #[doc = "Communication errors (UART, I2C, SPI, CAN), dropped packets on all links (packets that were corrupted on reception on the MAV)"]
28812 pub errors_comm: u16,
28813 #[doc = "Autopilot-specific errors"]
28814 pub errors_count1: u16,
28815 #[doc = "Autopilot-specific errors"]
28816 pub errors_count2: u16,
28817 #[doc = "Autopilot-specific errors"]
28818 pub errors_count3: u16,
28819 #[doc = "Autopilot-specific errors"]
28820 pub errors_count4: u16,
28821 #[doc = "Battery energy remaining, -1: Battery remaining energy not sent by autopilot"]
28822 pub battery_remaining: i8,
28823 #[doc = "Bitmap showing which onboard controllers and sensors are present. Value of 0: not present. Value of 1: present."]
28824 #[cfg_attr(feature = "serde", serde(default))]
28825 pub onboard_control_sensors_present_extended: MavSysStatusSensorExtended,
28826 #[doc = "Bitmap showing which onboard controllers and sensors are enabled: Value of 0: not enabled. Value of 1: enabled."]
28827 #[cfg_attr(feature = "serde", serde(default))]
28828 pub onboard_control_sensors_enabled_extended: MavSysStatusSensorExtended,
28829 #[doc = "Bitmap showing which onboard controllers and sensors have an error (or are operational). Value of 0: error. Value of 1: healthy."]
28830 #[cfg_attr(feature = "serde", serde(default))]
28831 pub onboard_control_sensors_health_extended: MavSysStatusSensorExtended,
28832}
28833impl SYS_STATUS_DATA {
28834 pub const ENCODED_LEN: usize = 43usize;
28835 pub const DEFAULT: Self = Self {
28836 onboard_control_sensors_present: MavSysStatusSensor::DEFAULT,
28837 onboard_control_sensors_enabled: MavSysStatusSensor::DEFAULT,
28838 onboard_control_sensors_health: MavSysStatusSensor::DEFAULT,
28839 load: 0_u16,
28840 voltage_battery: 0_u16,
28841 current_battery: 0_i16,
28842 drop_rate_comm: 0_u16,
28843 errors_comm: 0_u16,
28844 errors_count1: 0_u16,
28845 errors_count2: 0_u16,
28846 errors_count3: 0_u16,
28847 errors_count4: 0_u16,
28848 battery_remaining: 0_i8,
28849 onboard_control_sensors_present_extended: MavSysStatusSensorExtended::DEFAULT,
28850 onboard_control_sensors_enabled_extended: MavSysStatusSensorExtended::DEFAULT,
28851 onboard_control_sensors_health_extended: MavSysStatusSensorExtended::DEFAULT,
28852 };
28853 #[cfg(feature = "arbitrary")]
28854 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
28855 use arbitrary::{Arbitrary, Unstructured};
28856 let mut buf = [0u8; 1024];
28857 rng.fill_bytes(&mut buf);
28858 let mut unstructured = Unstructured::new(&buf);
28859 Self::arbitrary(&mut unstructured).unwrap_or_default()
28860 }
28861}
28862impl Default for SYS_STATUS_DATA {
28863 fn default() -> Self {
28864 Self::DEFAULT.clone()
28865 }
28866}
28867impl MessageData for SYS_STATUS_DATA {
28868 type Message = MavMessage;
28869 const ID: u32 = 1u32;
28870 const NAME: &'static str = "SYS_STATUS";
28871 const EXTRA_CRC: u8 = 124u8;
28872 const ENCODED_LEN: usize = 43usize;
28873 fn deser(
28874 _version: MavlinkVersion,
28875 __input: &[u8],
28876 ) -> Result<Self, ::mavlink_core::error::ParserError> {
28877 let avail_len = __input.len();
28878 let mut payload_buf = [0; Self::ENCODED_LEN];
28879 let mut buf = if avail_len < Self::ENCODED_LEN {
28880 payload_buf[0..avail_len].copy_from_slice(__input);
28881 Bytes::new(&payload_buf)
28882 } else {
28883 Bytes::new(__input)
28884 };
28885 let mut __struct = Self::default();
28886 let tmp = buf.get_u32_le();
28887 __struct.onboard_control_sensors_present = MavSysStatusSensor::from_bits(
28888 tmp & MavSysStatusSensor::all().bits(),
28889 )
28890 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
28891 flag_type: "MavSysStatusSensor",
28892 value: tmp as u32,
28893 })?;
28894 let tmp = buf.get_u32_le();
28895 __struct.onboard_control_sensors_enabled = MavSysStatusSensor::from_bits(
28896 tmp & MavSysStatusSensor::all().bits(),
28897 )
28898 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
28899 flag_type: "MavSysStatusSensor",
28900 value: tmp as u32,
28901 })?;
28902 let tmp = buf.get_u32_le();
28903 __struct.onboard_control_sensors_health = MavSysStatusSensor::from_bits(
28904 tmp & MavSysStatusSensor::all().bits(),
28905 )
28906 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
28907 flag_type: "MavSysStatusSensor",
28908 value: tmp as u32,
28909 })?;
28910 __struct.load = buf.get_u16_le();
28911 __struct.voltage_battery = buf.get_u16_le();
28912 __struct.current_battery = buf.get_i16_le();
28913 __struct.drop_rate_comm = buf.get_u16_le();
28914 __struct.errors_comm = buf.get_u16_le();
28915 __struct.errors_count1 = buf.get_u16_le();
28916 __struct.errors_count2 = buf.get_u16_le();
28917 __struct.errors_count3 = buf.get_u16_le();
28918 __struct.errors_count4 = buf.get_u16_le();
28919 __struct.battery_remaining = buf.get_i8();
28920 let tmp = buf.get_u32_le();
28921 __struct.onboard_control_sensors_present_extended =
28922 MavSysStatusSensorExtended::from_bits(tmp & MavSysStatusSensorExtended::all().bits())
28923 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
28924 flag_type: "MavSysStatusSensorExtended",
28925 value: tmp as u32,
28926 })?;
28927 let tmp = buf.get_u32_le();
28928 __struct.onboard_control_sensors_enabled_extended =
28929 MavSysStatusSensorExtended::from_bits(tmp & MavSysStatusSensorExtended::all().bits())
28930 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
28931 flag_type: "MavSysStatusSensorExtended",
28932 value: tmp as u32,
28933 })?;
28934 let tmp = buf.get_u32_le();
28935 __struct.onboard_control_sensors_health_extended =
28936 MavSysStatusSensorExtended::from_bits(tmp & MavSysStatusSensorExtended::all().bits())
28937 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
28938 flag_type: "MavSysStatusSensorExtended",
28939 value: tmp as u32,
28940 })?;
28941 Ok(__struct)
28942 }
28943 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
28944 let mut __tmp = BytesMut::new(bytes);
28945 #[allow(clippy::absurd_extreme_comparisons)]
28946 #[allow(unused_comparisons)]
28947 if __tmp.remaining() < Self::ENCODED_LEN {
28948 panic!(
28949 "buffer is too small (need {} bytes, but got {})",
28950 Self::ENCODED_LEN,
28951 __tmp.remaining(),
28952 )
28953 }
28954 __tmp.put_u32_le(self.onboard_control_sensors_present.bits());
28955 __tmp.put_u32_le(self.onboard_control_sensors_enabled.bits());
28956 __tmp.put_u32_le(self.onboard_control_sensors_health.bits());
28957 __tmp.put_u16_le(self.load);
28958 __tmp.put_u16_le(self.voltage_battery);
28959 __tmp.put_i16_le(self.current_battery);
28960 __tmp.put_u16_le(self.drop_rate_comm);
28961 __tmp.put_u16_le(self.errors_comm);
28962 __tmp.put_u16_le(self.errors_count1);
28963 __tmp.put_u16_le(self.errors_count2);
28964 __tmp.put_u16_le(self.errors_count3);
28965 __tmp.put_u16_le(self.errors_count4);
28966 __tmp.put_i8(self.battery_remaining);
28967 if matches!(version, MavlinkVersion::V2) {
28968 __tmp.put_u32_le(self.onboard_control_sensors_present_extended.bits());
28969 __tmp.put_u32_le(self.onboard_control_sensors_enabled_extended.bits());
28970 __tmp.put_u32_le(self.onboard_control_sensors_health_extended.bits());
28971 let len = __tmp.len();
28972 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
28973 } else {
28974 __tmp.len()
28975 }
28976 }
28977}
28978#[doc = "Request that the vehicle report terrain height at the given location (expected response is a TERRAIN_REPORT). Used by GCS to check if vehicle has all terrain data needed for a mission."]
28979#[doc = ""]
28980#[doc = "ID: 135"]
28981#[derive(Debug, Clone, PartialEq)]
28982#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
28983#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
28984pub struct TERRAIN_CHECK_DATA {
28985 #[doc = "Latitude"]
28986 pub lat: i32,
28987 #[doc = "Longitude"]
28988 pub lon: i32,
28989}
28990impl TERRAIN_CHECK_DATA {
28991 pub const ENCODED_LEN: usize = 8usize;
28992 pub const DEFAULT: Self = Self {
28993 lat: 0_i32,
28994 lon: 0_i32,
28995 };
28996 #[cfg(feature = "arbitrary")]
28997 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
28998 use arbitrary::{Arbitrary, Unstructured};
28999 let mut buf = [0u8; 1024];
29000 rng.fill_bytes(&mut buf);
29001 let mut unstructured = Unstructured::new(&buf);
29002 Self::arbitrary(&mut unstructured).unwrap_or_default()
29003 }
29004}
29005impl Default for TERRAIN_CHECK_DATA {
29006 fn default() -> Self {
29007 Self::DEFAULT.clone()
29008 }
29009}
29010impl MessageData for TERRAIN_CHECK_DATA {
29011 type Message = MavMessage;
29012 const ID: u32 = 135u32;
29013 const NAME: &'static str = "TERRAIN_CHECK";
29014 const EXTRA_CRC: u8 = 203u8;
29015 const ENCODED_LEN: usize = 8usize;
29016 fn deser(
29017 _version: MavlinkVersion,
29018 __input: &[u8],
29019 ) -> Result<Self, ::mavlink_core::error::ParserError> {
29020 let avail_len = __input.len();
29021 let mut payload_buf = [0; Self::ENCODED_LEN];
29022 let mut buf = if avail_len < Self::ENCODED_LEN {
29023 payload_buf[0..avail_len].copy_from_slice(__input);
29024 Bytes::new(&payload_buf)
29025 } else {
29026 Bytes::new(__input)
29027 };
29028 let mut __struct = Self::default();
29029 __struct.lat = buf.get_i32_le();
29030 __struct.lon = buf.get_i32_le();
29031 Ok(__struct)
29032 }
29033 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
29034 let mut __tmp = BytesMut::new(bytes);
29035 #[allow(clippy::absurd_extreme_comparisons)]
29036 #[allow(unused_comparisons)]
29037 if __tmp.remaining() < Self::ENCODED_LEN {
29038 panic!(
29039 "buffer is too small (need {} bytes, but got {})",
29040 Self::ENCODED_LEN,
29041 __tmp.remaining(),
29042 )
29043 }
29044 __tmp.put_i32_le(self.lat);
29045 __tmp.put_i32_le(self.lon);
29046 if matches!(version, MavlinkVersion::V2) {
29047 let len = __tmp.len();
29048 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
29049 } else {
29050 __tmp.len()
29051 }
29052 }
29053}
29054#[doc = "Terrain data sent from GCS. The lat/lon and grid_spacing must be the same as a lat/lon from a TERRAIN_REQUEST. See terrain protocol docs: <https://mavlink.io/en/services/terrain.html>."]
29055#[doc = ""]
29056#[doc = "ID: 134"]
29057#[derive(Debug, Clone, PartialEq)]
29058#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
29059#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
29060pub struct TERRAIN_DATA_DATA {
29061 #[doc = "Latitude of SW corner of first grid"]
29062 pub lat: i32,
29063 #[doc = "Longitude of SW corner of first grid"]
29064 pub lon: i32,
29065 #[doc = "Grid spacing"]
29066 pub grid_spacing: u16,
29067 #[doc = "Terrain data MSL"]
29068 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
29069 pub data: [i16; 16],
29070 #[doc = "bit within the terrain request mask"]
29071 pub gridbit: u8,
29072}
29073impl TERRAIN_DATA_DATA {
29074 pub const ENCODED_LEN: usize = 43usize;
29075 pub const DEFAULT: Self = Self {
29076 lat: 0_i32,
29077 lon: 0_i32,
29078 grid_spacing: 0_u16,
29079 data: [0_i16; 16usize],
29080 gridbit: 0_u8,
29081 };
29082 #[cfg(feature = "arbitrary")]
29083 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
29084 use arbitrary::{Arbitrary, Unstructured};
29085 let mut buf = [0u8; 1024];
29086 rng.fill_bytes(&mut buf);
29087 let mut unstructured = Unstructured::new(&buf);
29088 Self::arbitrary(&mut unstructured).unwrap_or_default()
29089 }
29090}
29091impl Default for TERRAIN_DATA_DATA {
29092 fn default() -> Self {
29093 Self::DEFAULT.clone()
29094 }
29095}
29096impl MessageData for TERRAIN_DATA_DATA {
29097 type Message = MavMessage;
29098 const ID: u32 = 134u32;
29099 const NAME: &'static str = "TERRAIN_DATA";
29100 const EXTRA_CRC: u8 = 229u8;
29101 const ENCODED_LEN: usize = 43usize;
29102 fn deser(
29103 _version: MavlinkVersion,
29104 __input: &[u8],
29105 ) -> Result<Self, ::mavlink_core::error::ParserError> {
29106 let avail_len = __input.len();
29107 let mut payload_buf = [0; Self::ENCODED_LEN];
29108 let mut buf = if avail_len < Self::ENCODED_LEN {
29109 payload_buf[0..avail_len].copy_from_slice(__input);
29110 Bytes::new(&payload_buf)
29111 } else {
29112 Bytes::new(__input)
29113 };
29114 let mut __struct = Self::default();
29115 __struct.lat = buf.get_i32_le();
29116 __struct.lon = buf.get_i32_le();
29117 __struct.grid_spacing = buf.get_u16_le();
29118 for v in &mut __struct.data {
29119 let val = buf.get_i16_le();
29120 *v = val;
29121 }
29122 __struct.gridbit = buf.get_u8();
29123 Ok(__struct)
29124 }
29125 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
29126 let mut __tmp = BytesMut::new(bytes);
29127 #[allow(clippy::absurd_extreme_comparisons)]
29128 #[allow(unused_comparisons)]
29129 if __tmp.remaining() < Self::ENCODED_LEN {
29130 panic!(
29131 "buffer is too small (need {} bytes, but got {})",
29132 Self::ENCODED_LEN,
29133 __tmp.remaining(),
29134 )
29135 }
29136 __tmp.put_i32_le(self.lat);
29137 __tmp.put_i32_le(self.lon);
29138 __tmp.put_u16_le(self.grid_spacing);
29139 for val in &self.data {
29140 __tmp.put_i16_le(*val);
29141 }
29142 __tmp.put_u8(self.gridbit);
29143 if matches!(version, MavlinkVersion::V2) {
29144 let len = __tmp.len();
29145 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
29146 } else {
29147 __tmp.len()
29148 }
29149 }
29150}
29151#[doc = "Streamed from drone to report progress of terrain map download (initiated by TERRAIN_REQUEST), or sent as a response to a TERRAIN_CHECK request. See terrain protocol docs: <https://mavlink.io/en/services/terrain.html>."]
29152#[doc = ""]
29153#[doc = "ID: 136"]
29154#[derive(Debug, Clone, PartialEq)]
29155#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
29156#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
29157pub struct TERRAIN_REPORT_DATA {
29158 #[doc = "Latitude"]
29159 pub lat: i32,
29160 #[doc = "Longitude"]
29161 pub lon: i32,
29162 #[doc = "Terrain height MSL"]
29163 pub terrain_height: f32,
29164 #[doc = "Current vehicle height above lat/lon terrain height"]
29165 pub current_height: f32,
29166 #[doc = "grid spacing (zero if terrain at this location unavailable)"]
29167 pub spacing: u16,
29168 #[doc = "Number of 4x4 terrain blocks waiting to be received or read from disk"]
29169 pub pending: u16,
29170 #[doc = "Number of 4x4 terrain blocks in memory"]
29171 pub loaded: u16,
29172}
29173impl TERRAIN_REPORT_DATA {
29174 pub const ENCODED_LEN: usize = 22usize;
29175 pub const DEFAULT: Self = Self {
29176 lat: 0_i32,
29177 lon: 0_i32,
29178 terrain_height: 0.0_f32,
29179 current_height: 0.0_f32,
29180 spacing: 0_u16,
29181 pending: 0_u16,
29182 loaded: 0_u16,
29183 };
29184 #[cfg(feature = "arbitrary")]
29185 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
29186 use arbitrary::{Arbitrary, Unstructured};
29187 let mut buf = [0u8; 1024];
29188 rng.fill_bytes(&mut buf);
29189 let mut unstructured = Unstructured::new(&buf);
29190 Self::arbitrary(&mut unstructured).unwrap_or_default()
29191 }
29192}
29193impl Default for TERRAIN_REPORT_DATA {
29194 fn default() -> Self {
29195 Self::DEFAULT.clone()
29196 }
29197}
29198impl MessageData for TERRAIN_REPORT_DATA {
29199 type Message = MavMessage;
29200 const ID: u32 = 136u32;
29201 const NAME: &'static str = "TERRAIN_REPORT";
29202 const EXTRA_CRC: u8 = 1u8;
29203 const ENCODED_LEN: usize = 22usize;
29204 fn deser(
29205 _version: MavlinkVersion,
29206 __input: &[u8],
29207 ) -> Result<Self, ::mavlink_core::error::ParserError> {
29208 let avail_len = __input.len();
29209 let mut payload_buf = [0; Self::ENCODED_LEN];
29210 let mut buf = if avail_len < Self::ENCODED_LEN {
29211 payload_buf[0..avail_len].copy_from_slice(__input);
29212 Bytes::new(&payload_buf)
29213 } else {
29214 Bytes::new(__input)
29215 };
29216 let mut __struct = Self::default();
29217 __struct.lat = buf.get_i32_le();
29218 __struct.lon = buf.get_i32_le();
29219 __struct.terrain_height = buf.get_f32_le();
29220 __struct.current_height = buf.get_f32_le();
29221 __struct.spacing = buf.get_u16_le();
29222 __struct.pending = buf.get_u16_le();
29223 __struct.loaded = buf.get_u16_le();
29224 Ok(__struct)
29225 }
29226 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
29227 let mut __tmp = BytesMut::new(bytes);
29228 #[allow(clippy::absurd_extreme_comparisons)]
29229 #[allow(unused_comparisons)]
29230 if __tmp.remaining() < Self::ENCODED_LEN {
29231 panic!(
29232 "buffer is too small (need {} bytes, but got {})",
29233 Self::ENCODED_LEN,
29234 __tmp.remaining(),
29235 )
29236 }
29237 __tmp.put_i32_le(self.lat);
29238 __tmp.put_i32_le(self.lon);
29239 __tmp.put_f32_le(self.terrain_height);
29240 __tmp.put_f32_le(self.current_height);
29241 __tmp.put_u16_le(self.spacing);
29242 __tmp.put_u16_le(self.pending);
29243 __tmp.put_u16_le(self.loaded);
29244 if matches!(version, MavlinkVersion::V2) {
29245 let len = __tmp.len();
29246 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
29247 } else {
29248 __tmp.len()
29249 }
29250 }
29251}
29252#[doc = "Request for terrain data and terrain status. See terrain protocol docs: <https://mavlink.io/en/services/terrain.html>."]
29253#[doc = ""]
29254#[doc = "ID: 133"]
29255#[derive(Debug, Clone, PartialEq)]
29256#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
29257#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
29258pub struct TERRAIN_REQUEST_DATA {
29259 #[doc = "Bitmask of requested 4x4 grids (row major 8x7 array of grids, 56 bits)"]
29260 pub mask: u64,
29261 #[doc = "Latitude of SW corner of first grid"]
29262 pub lat: i32,
29263 #[doc = "Longitude of SW corner of first grid"]
29264 pub lon: i32,
29265 #[doc = "Grid spacing"]
29266 pub grid_spacing: u16,
29267}
29268impl TERRAIN_REQUEST_DATA {
29269 pub const ENCODED_LEN: usize = 18usize;
29270 pub const DEFAULT: Self = Self {
29271 mask: 0_u64,
29272 lat: 0_i32,
29273 lon: 0_i32,
29274 grid_spacing: 0_u16,
29275 };
29276 #[cfg(feature = "arbitrary")]
29277 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
29278 use arbitrary::{Arbitrary, Unstructured};
29279 let mut buf = [0u8; 1024];
29280 rng.fill_bytes(&mut buf);
29281 let mut unstructured = Unstructured::new(&buf);
29282 Self::arbitrary(&mut unstructured).unwrap_or_default()
29283 }
29284}
29285impl Default for TERRAIN_REQUEST_DATA {
29286 fn default() -> Self {
29287 Self::DEFAULT.clone()
29288 }
29289}
29290impl MessageData for TERRAIN_REQUEST_DATA {
29291 type Message = MavMessage;
29292 const ID: u32 = 133u32;
29293 const NAME: &'static str = "TERRAIN_REQUEST";
29294 const EXTRA_CRC: u8 = 6u8;
29295 const ENCODED_LEN: usize = 18usize;
29296 fn deser(
29297 _version: MavlinkVersion,
29298 __input: &[u8],
29299 ) -> Result<Self, ::mavlink_core::error::ParserError> {
29300 let avail_len = __input.len();
29301 let mut payload_buf = [0; Self::ENCODED_LEN];
29302 let mut buf = if avail_len < Self::ENCODED_LEN {
29303 payload_buf[0..avail_len].copy_from_slice(__input);
29304 Bytes::new(&payload_buf)
29305 } else {
29306 Bytes::new(__input)
29307 };
29308 let mut __struct = Self::default();
29309 __struct.mask = buf.get_u64_le();
29310 __struct.lat = buf.get_i32_le();
29311 __struct.lon = buf.get_i32_le();
29312 __struct.grid_spacing = buf.get_u16_le();
29313 Ok(__struct)
29314 }
29315 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
29316 let mut __tmp = BytesMut::new(bytes);
29317 #[allow(clippy::absurd_extreme_comparisons)]
29318 #[allow(unused_comparisons)]
29319 if __tmp.remaining() < Self::ENCODED_LEN {
29320 panic!(
29321 "buffer is too small (need {} bytes, but got {})",
29322 Self::ENCODED_LEN,
29323 __tmp.remaining(),
29324 )
29325 }
29326 __tmp.put_u64_le(self.mask);
29327 __tmp.put_i32_le(self.lat);
29328 __tmp.put_i32_le(self.lon);
29329 __tmp.put_u16_le(self.grid_spacing);
29330 if matches!(version, MavlinkVersion::V2) {
29331 let len = __tmp.len();
29332 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
29333 } else {
29334 __tmp.len()
29335 }
29336 }
29337}
29338#[doc = "Time synchronization message. The message is used for both timesync requests and responses. The request is sent with `ts1=syncing component timestamp` and `tc1=0`, and may be broadcast or targeted to a specific system/component. The response is sent with `ts1=syncing component timestamp` (mirror back unchanged), and `tc1=responding component timestamp`, with the `target_system` and `target_component` set to ids of the original request. Systems can determine if they are receiving a request or response based on the value of `tc`. If the response has `target_system==target_component==0` the remote system has not been updated to use the component IDs and cannot reliably timesync; the requestor may report an error. Timestamps are UNIX Epoch time or time since system boot in nanoseconds (the timestamp format can be inferred by checking for the magnitude of the number; generally it doesn't matter as only the offset is used). The message sequence is repeated numerous times with results being filtered/averaged to estimate the offset. See also: <https://mavlink.io/en/services/timesync.html>."]
29339#[doc = ""]
29340#[doc = "ID: 111"]
29341#[derive(Debug, Clone, PartialEq)]
29342#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
29343#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
29344pub struct TIMESYNC_DATA {
29345 #[doc = "Time sync timestamp 1. Syncing: 0. Responding: Timestamp of responding component."]
29346 pub tc1: i64,
29347 #[doc = "Time sync timestamp 2. Timestamp of syncing component (mirrored in response)."]
29348 pub ts1: i64,
29349 #[doc = "Target system id. Request: 0 (broadcast) or id of specific system. Response must contain system id of the requesting component."]
29350 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
29351 pub target_system: u8,
29352 #[doc = "Target component id. Request: 0 (broadcast) or id of specific component. Response must contain component id of the requesting component."]
29353 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
29354 pub target_component: u8,
29355}
29356impl TIMESYNC_DATA {
29357 pub const ENCODED_LEN: usize = 18usize;
29358 pub const DEFAULT: Self = Self {
29359 tc1: 0_i64,
29360 ts1: 0_i64,
29361 target_system: 0_u8,
29362 target_component: 0_u8,
29363 };
29364 #[cfg(feature = "arbitrary")]
29365 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
29366 use arbitrary::{Arbitrary, Unstructured};
29367 let mut buf = [0u8; 1024];
29368 rng.fill_bytes(&mut buf);
29369 let mut unstructured = Unstructured::new(&buf);
29370 Self::arbitrary(&mut unstructured).unwrap_or_default()
29371 }
29372}
29373impl Default for TIMESYNC_DATA {
29374 fn default() -> Self {
29375 Self::DEFAULT.clone()
29376 }
29377}
29378impl MessageData for TIMESYNC_DATA {
29379 type Message = MavMessage;
29380 const ID: u32 = 111u32;
29381 const NAME: &'static str = "TIMESYNC";
29382 const EXTRA_CRC: u8 = 34u8;
29383 const ENCODED_LEN: usize = 18usize;
29384 fn deser(
29385 _version: MavlinkVersion,
29386 __input: &[u8],
29387 ) -> Result<Self, ::mavlink_core::error::ParserError> {
29388 let avail_len = __input.len();
29389 let mut payload_buf = [0; Self::ENCODED_LEN];
29390 let mut buf = if avail_len < Self::ENCODED_LEN {
29391 payload_buf[0..avail_len].copy_from_slice(__input);
29392 Bytes::new(&payload_buf)
29393 } else {
29394 Bytes::new(__input)
29395 };
29396 let mut __struct = Self::default();
29397 __struct.tc1 = buf.get_i64_le();
29398 __struct.ts1 = buf.get_i64_le();
29399 __struct.target_system = buf.get_u8();
29400 __struct.target_component = buf.get_u8();
29401 Ok(__struct)
29402 }
29403 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
29404 let mut __tmp = BytesMut::new(bytes);
29405 #[allow(clippy::absurd_extreme_comparisons)]
29406 #[allow(unused_comparisons)]
29407 if __tmp.remaining() < Self::ENCODED_LEN {
29408 panic!(
29409 "buffer is too small (need {} bytes, but got {})",
29410 Self::ENCODED_LEN,
29411 __tmp.remaining(),
29412 )
29413 }
29414 __tmp.put_i64_le(self.tc1);
29415 __tmp.put_i64_le(self.ts1);
29416 if matches!(version, MavlinkVersion::V2) {
29417 __tmp.put_u8(self.target_system);
29418 __tmp.put_u8(self.target_component);
29419 let len = __tmp.len();
29420 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
29421 } else {
29422 __tmp.len()
29423 }
29424 }
29425}
29426#[doc = "Time/duration estimates for various events and actions given the current vehicle state and position."]
29427#[doc = ""]
29428#[doc = "ID: 380"]
29429#[derive(Debug, Clone, PartialEq)]
29430#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
29431#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
29432pub struct TIME_ESTIMATE_TO_TARGET_DATA {
29433 #[doc = "Estimated time to complete the vehicle's configured \"safe return\" action from its current position (e.g. RTL, Smart RTL, etc.). -1 indicates that the vehicle is landed, or that no time estimate available."]
29434 pub safe_return: i32,
29435 #[doc = "Estimated time for vehicle to complete the LAND action from its current position. -1 indicates that the vehicle is landed, or that no time estimate available."]
29436 pub land: i32,
29437 #[doc = "Estimated time for reaching/completing the currently active mission item. -1 means no time estimate available."]
29438 pub mission_next_item: i32,
29439 #[doc = "Estimated time for completing the current mission. -1 means no mission active and/or no estimate available."]
29440 pub mission_end: i32,
29441 #[doc = "Estimated time for completing the current commanded action (i.e. Go To, Takeoff, Land, etc.). -1 means no action active and/or no estimate available."]
29442 pub commanded_action: i32,
29443}
29444impl TIME_ESTIMATE_TO_TARGET_DATA {
29445 pub const ENCODED_LEN: usize = 20usize;
29446 pub const DEFAULT: Self = Self {
29447 safe_return: 0_i32,
29448 land: 0_i32,
29449 mission_next_item: 0_i32,
29450 mission_end: 0_i32,
29451 commanded_action: 0_i32,
29452 };
29453 #[cfg(feature = "arbitrary")]
29454 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
29455 use arbitrary::{Arbitrary, Unstructured};
29456 let mut buf = [0u8; 1024];
29457 rng.fill_bytes(&mut buf);
29458 let mut unstructured = Unstructured::new(&buf);
29459 Self::arbitrary(&mut unstructured).unwrap_or_default()
29460 }
29461}
29462impl Default for TIME_ESTIMATE_TO_TARGET_DATA {
29463 fn default() -> Self {
29464 Self::DEFAULT.clone()
29465 }
29466}
29467impl MessageData for TIME_ESTIMATE_TO_TARGET_DATA {
29468 type Message = MavMessage;
29469 const ID: u32 = 380u32;
29470 const NAME: &'static str = "TIME_ESTIMATE_TO_TARGET";
29471 const EXTRA_CRC: u8 = 232u8;
29472 const ENCODED_LEN: usize = 20usize;
29473 fn deser(
29474 _version: MavlinkVersion,
29475 __input: &[u8],
29476 ) -> Result<Self, ::mavlink_core::error::ParserError> {
29477 let avail_len = __input.len();
29478 let mut payload_buf = [0; Self::ENCODED_LEN];
29479 let mut buf = if avail_len < Self::ENCODED_LEN {
29480 payload_buf[0..avail_len].copy_from_slice(__input);
29481 Bytes::new(&payload_buf)
29482 } else {
29483 Bytes::new(__input)
29484 };
29485 let mut __struct = Self::default();
29486 __struct.safe_return = buf.get_i32_le();
29487 __struct.land = buf.get_i32_le();
29488 __struct.mission_next_item = buf.get_i32_le();
29489 __struct.mission_end = buf.get_i32_le();
29490 __struct.commanded_action = buf.get_i32_le();
29491 Ok(__struct)
29492 }
29493 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
29494 let mut __tmp = BytesMut::new(bytes);
29495 #[allow(clippy::absurd_extreme_comparisons)]
29496 #[allow(unused_comparisons)]
29497 if __tmp.remaining() < Self::ENCODED_LEN {
29498 panic!(
29499 "buffer is too small (need {} bytes, but got {})",
29500 Self::ENCODED_LEN,
29501 __tmp.remaining(),
29502 )
29503 }
29504 __tmp.put_i32_le(self.safe_return);
29505 __tmp.put_i32_le(self.land);
29506 __tmp.put_i32_le(self.mission_next_item);
29507 __tmp.put_i32_le(self.mission_end);
29508 __tmp.put_i32_le(self.commanded_action);
29509 if matches!(version, MavlinkVersion::V2) {
29510 let len = __tmp.len();
29511 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
29512 } else {
29513 __tmp.len()
29514 }
29515 }
29516}
29517#[doc = "Describe a trajectory using an array of up-to 5 bezier control points in the local frame (MAV_FRAME_LOCAL_NED)."]
29518#[doc = ""]
29519#[doc = "ID: 333"]
29520#[derive(Debug, Clone, PartialEq)]
29521#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
29522#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
29523pub struct TRAJECTORY_REPRESENTATION_BEZIER_DATA {
29524 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
29525 pub time_usec: u64,
29526 #[doc = "X-coordinate of bezier control points. Set to NaN if not being used"]
29527 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
29528 pub pos_x: [f32; 5],
29529 #[doc = "Y-coordinate of bezier control points. Set to NaN if not being used"]
29530 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
29531 pub pos_y: [f32; 5],
29532 #[doc = "Z-coordinate of bezier control points. Set to NaN if not being used"]
29533 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
29534 pub pos_z: [f32; 5],
29535 #[doc = "Bezier time horizon. Set to NaN if velocity/acceleration should not be incorporated"]
29536 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
29537 pub delta: [f32; 5],
29538 #[doc = "Yaw. Set to NaN for unchanged"]
29539 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
29540 pub pos_yaw: [f32; 5],
29541 #[doc = "Number of valid control points (up-to 5 points are possible)"]
29542 pub valid_points: u8,
29543}
29544impl TRAJECTORY_REPRESENTATION_BEZIER_DATA {
29545 pub const ENCODED_LEN: usize = 109usize;
29546 pub const DEFAULT: Self = Self {
29547 time_usec: 0_u64,
29548 pos_x: [0.0_f32; 5usize],
29549 pos_y: [0.0_f32; 5usize],
29550 pos_z: [0.0_f32; 5usize],
29551 delta: [0.0_f32; 5usize],
29552 pos_yaw: [0.0_f32; 5usize],
29553 valid_points: 0_u8,
29554 };
29555 #[cfg(feature = "arbitrary")]
29556 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
29557 use arbitrary::{Arbitrary, Unstructured};
29558 let mut buf = [0u8; 1024];
29559 rng.fill_bytes(&mut buf);
29560 let mut unstructured = Unstructured::new(&buf);
29561 Self::arbitrary(&mut unstructured).unwrap_or_default()
29562 }
29563}
29564impl Default for TRAJECTORY_REPRESENTATION_BEZIER_DATA {
29565 fn default() -> Self {
29566 Self::DEFAULT.clone()
29567 }
29568}
29569impl MessageData for TRAJECTORY_REPRESENTATION_BEZIER_DATA {
29570 type Message = MavMessage;
29571 const ID: u32 = 333u32;
29572 const NAME: &'static str = "TRAJECTORY_REPRESENTATION_BEZIER";
29573 const EXTRA_CRC: u8 = 231u8;
29574 const ENCODED_LEN: usize = 109usize;
29575 fn deser(
29576 _version: MavlinkVersion,
29577 __input: &[u8],
29578 ) -> Result<Self, ::mavlink_core::error::ParserError> {
29579 let avail_len = __input.len();
29580 let mut payload_buf = [0; Self::ENCODED_LEN];
29581 let mut buf = if avail_len < Self::ENCODED_LEN {
29582 payload_buf[0..avail_len].copy_from_slice(__input);
29583 Bytes::new(&payload_buf)
29584 } else {
29585 Bytes::new(__input)
29586 };
29587 let mut __struct = Self::default();
29588 __struct.time_usec = buf.get_u64_le();
29589 for v in &mut __struct.pos_x {
29590 let val = buf.get_f32_le();
29591 *v = val;
29592 }
29593 for v in &mut __struct.pos_y {
29594 let val = buf.get_f32_le();
29595 *v = val;
29596 }
29597 for v in &mut __struct.pos_z {
29598 let val = buf.get_f32_le();
29599 *v = val;
29600 }
29601 for v in &mut __struct.delta {
29602 let val = buf.get_f32_le();
29603 *v = val;
29604 }
29605 for v in &mut __struct.pos_yaw {
29606 let val = buf.get_f32_le();
29607 *v = val;
29608 }
29609 __struct.valid_points = buf.get_u8();
29610 Ok(__struct)
29611 }
29612 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
29613 let mut __tmp = BytesMut::new(bytes);
29614 #[allow(clippy::absurd_extreme_comparisons)]
29615 #[allow(unused_comparisons)]
29616 if __tmp.remaining() < Self::ENCODED_LEN {
29617 panic!(
29618 "buffer is too small (need {} bytes, but got {})",
29619 Self::ENCODED_LEN,
29620 __tmp.remaining(),
29621 )
29622 }
29623 __tmp.put_u64_le(self.time_usec);
29624 for val in &self.pos_x {
29625 __tmp.put_f32_le(*val);
29626 }
29627 for val in &self.pos_y {
29628 __tmp.put_f32_le(*val);
29629 }
29630 for val in &self.pos_z {
29631 __tmp.put_f32_le(*val);
29632 }
29633 for val in &self.delta {
29634 __tmp.put_f32_le(*val);
29635 }
29636 for val in &self.pos_yaw {
29637 __tmp.put_f32_le(*val);
29638 }
29639 __tmp.put_u8(self.valid_points);
29640 if matches!(version, MavlinkVersion::V2) {
29641 let len = __tmp.len();
29642 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
29643 } else {
29644 __tmp.len()
29645 }
29646 }
29647}
29648#[doc = "Describe a trajectory using an array of up-to 5 waypoints in the local frame (MAV_FRAME_LOCAL_NED)."]
29649#[doc = ""]
29650#[doc = "ID: 332"]
29651#[derive(Debug, Clone, PartialEq)]
29652#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
29653#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
29654pub struct TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA {
29655 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
29656 pub time_usec: u64,
29657 #[doc = "X-coordinate of waypoint, set to NaN if not being used"]
29658 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
29659 pub pos_x: [f32; 5],
29660 #[doc = "Y-coordinate of waypoint, set to NaN if not being used"]
29661 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
29662 pub pos_y: [f32; 5],
29663 #[doc = "Z-coordinate of waypoint, set to NaN if not being used"]
29664 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
29665 pub pos_z: [f32; 5],
29666 #[doc = "X-velocity of waypoint, set to NaN if not being used"]
29667 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
29668 pub vel_x: [f32; 5],
29669 #[doc = "Y-velocity of waypoint, set to NaN if not being used"]
29670 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
29671 pub vel_y: [f32; 5],
29672 #[doc = "Z-velocity of waypoint, set to NaN if not being used"]
29673 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
29674 pub vel_z: [f32; 5],
29675 #[doc = "X-acceleration of waypoint, set to NaN if not being used"]
29676 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
29677 pub acc_x: [f32; 5],
29678 #[doc = "Y-acceleration of waypoint, set to NaN if not being used"]
29679 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
29680 pub acc_y: [f32; 5],
29681 #[doc = "Z-acceleration of waypoint, set to NaN if not being used"]
29682 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
29683 pub acc_z: [f32; 5],
29684 #[doc = "Yaw angle, set to NaN if not being used"]
29685 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
29686 pub pos_yaw: [f32; 5],
29687 #[doc = "Yaw rate, set to NaN if not being used"]
29688 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
29689 pub vel_yaw: [f32; 5],
29690 #[doc = "MAV_CMD command id of waypoint, set to UINT16_MAX if not being used."]
29691 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
29692 pub command: [u16; 5],
29693 #[doc = "Number of valid points (up-to 5 waypoints are possible)"]
29694 pub valid_points: u8,
29695}
29696impl TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA {
29697 pub const ENCODED_LEN: usize = 239usize;
29698 pub const DEFAULT: Self = Self {
29699 time_usec: 0_u64,
29700 pos_x: [0.0_f32; 5usize],
29701 pos_y: [0.0_f32; 5usize],
29702 pos_z: [0.0_f32; 5usize],
29703 vel_x: [0.0_f32; 5usize],
29704 vel_y: [0.0_f32; 5usize],
29705 vel_z: [0.0_f32; 5usize],
29706 acc_x: [0.0_f32; 5usize],
29707 acc_y: [0.0_f32; 5usize],
29708 acc_z: [0.0_f32; 5usize],
29709 pos_yaw: [0.0_f32; 5usize],
29710 vel_yaw: [0.0_f32; 5usize],
29711 command: [0_u16; 5usize],
29712 valid_points: 0_u8,
29713 };
29714 #[cfg(feature = "arbitrary")]
29715 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
29716 use arbitrary::{Arbitrary, Unstructured};
29717 let mut buf = [0u8; 1024];
29718 rng.fill_bytes(&mut buf);
29719 let mut unstructured = Unstructured::new(&buf);
29720 Self::arbitrary(&mut unstructured).unwrap_or_default()
29721 }
29722}
29723impl Default for TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA {
29724 fn default() -> Self {
29725 Self::DEFAULT.clone()
29726 }
29727}
29728impl MessageData for TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA {
29729 type Message = MavMessage;
29730 const ID: u32 = 332u32;
29731 const NAME: &'static str = "TRAJECTORY_REPRESENTATION_WAYPOINTS";
29732 const EXTRA_CRC: u8 = 236u8;
29733 const ENCODED_LEN: usize = 239usize;
29734 fn deser(
29735 _version: MavlinkVersion,
29736 __input: &[u8],
29737 ) -> Result<Self, ::mavlink_core::error::ParserError> {
29738 let avail_len = __input.len();
29739 let mut payload_buf = [0; Self::ENCODED_LEN];
29740 let mut buf = if avail_len < Self::ENCODED_LEN {
29741 payload_buf[0..avail_len].copy_from_slice(__input);
29742 Bytes::new(&payload_buf)
29743 } else {
29744 Bytes::new(__input)
29745 };
29746 let mut __struct = Self::default();
29747 __struct.time_usec = buf.get_u64_le();
29748 for v in &mut __struct.pos_x {
29749 let val = buf.get_f32_le();
29750 *v = val;
29751 }
29752 for v in &mut __struct.pos_y {
29753 let val = buf.get_f32_le();
29754 *v = val;
29755 }
29756 for v in &mut __struct.pos_z {
29757 let val = buf.get_f32_le();
29758 *v = val;
29759 }
29760 for v in &mut __struct.vel_x {
29761 let val = buf.get_f32_le();
29762 *v = val;
29763 }
29764 for v in &mut __struct.vel_y {
29765 let val = buf.get_f32_le();
29766 *v = val;
29767 }
29768 for v in &mut __struct.vel_z {
29769 let val = buf.get_f32_le();
29770 *v = val;
29771 }
29772 for v in &mut __struct.acc_x {
29773 let val = buf.get_f32_le();
29774 *v = val;
29775 }
29776 for v in &mut __struct.acc_y {
29777 let val = buf.get_f32_le();
29778 *v = val;
29779 }
29780 for v in &mut __struct.acc_z {
29781 let val = buf.get_f32_le();
29782 *v = val;
29783 }
29784 for v in &mut __struct.pos_yaw {
29785 let val = buf.get_f32_le();
29786 *v = val;
29787 }
29788 for v in &mut __struct.vel_yaw {
29789 let val = buf.get_f32_le();
29790 *v = val;
29791 }
29792 for v in &mut __struct.command {
29793 let val = buf.get_u16_le();
29794 *v = val;
29795 }
29796 __struct.valid_points = buf.get_u8();
29797 Ok(__struct)
29798 }
29799 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
29800 let mut __tmp = BytesMut::new(bytes);
29801 #[allow(clippy::absurd_extreme_comparisons)]
29802 #[allow(unused_comparisons)]
29803 if __tmp.remaining() < Self::ENCODED_LEN {
29804 panic!(
29805 "buffer is too small (need {} bytes, but got {})",
29806 Self::ENCODED_LEN,
29807 __tmp.remaining(),
29808 )
29809 }
29810 __tmp.put_u64_le(self.time_usec);
29811 for val in &self.pos_x {
29812 __tmp.put_f32_le(*val);
29813 }
29814 for val in &self.pos_y {
29815 __tmp.put_f32_le(*val);
29816 }
29817 for val in &self.pos_z {
29818 __tmp.put_f32_le(*val);
29819 }
29820 for val in &self.vel_x {
29821 __tmp.put_f32_le(*val);
29822 }
29823 for val in &self.vel_y {
29824 __tmp.put_f32_le(*val);
29825 }
29826 for val in &self.vel_z {
29827 __tmp.put_f32_le(*val);
29828 }
29829 for val in &self.acc_x {
29830 __tmp.put_f32_le(*val);
29831 }
29832 for val in &self.acc_y {
29833 __tmp.put_f32_le(*val);
29834 }
29835 for val in &self.acc_z {
29836 __tmp.put_f32_le(*val);
29837 }
29838 for val in &self.pos_yaw {
29839 __tmp.put_f32_le(*val);
29840 }
29841 for val in &self.vel_yaw {
29842 __tmp.put_f32_le(*val);
29843 }
29844 for val in &self.command {
29845 __tmp.put_u16_le(*val);
29846 }
29847 __tmp.put_u8(self.valid_points);
29848 if matches!(version, MavlinkVersion::V2) {
29849 let len = __tmp.len();
29850 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
29851 } else {
29852 __tmp.len()
29853 }
29854 }
29855}
29856#[doc = "Message for transporting \"arbitrary\" variable-length data from one component to another (broadcast is not forbidden, but discouraged). The encoding of the data is usually extension specific, i.e. determined by the source, and is usually not documented as part of the MAVLink specification."]
29857#[doc = ""]
29858#[doc = "ID: 385"]
29859#[derive(Debug, Clone, PartialEq)]
29860#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
29861#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
29862pub struct TUNNEL_DATA {
29863 #[doc = "A code that identifies the content of the payload (0 for unknown, which is the default). If this code is less than 32768, it is a 'registered' payload type and the corresponding code should be added to the MAV_TUNNEL_PAYLOAD_TYPE enum. Software creators can register blocks of types as needed. Codes greater than 32767 are considered local experiments and should not be checked in to any widely distributed codebase."]
29864 pub payload_type: MavTunnelPayloadType,
29865 #[doc = "System ID (can be 0 for broadcast, but this is discouraged)"]
29866 pub target_system: u8,
29867 #[doc = "Component ID (can be 0 for broadcast, but this is discouraged)"]
29868 pub target_component: u8,
29869 #[doc = "Length of the data transported in payload"]
29870 pub payload_length: u8,
29871 #[doc = "Variable length payload. The payload length is defined by payload_length. The entire content of this block is opaque unless you understand the encoding specified by payload_type."]
29872 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
29873 pub payload: [u8; 128],
29874}
29875impl TUNNEL_DATA {
29876 pub const ENCODED_LEN: usize = 133usize;
29877 pub const DEFAULT: Self = Self {
29878 payload_type: MavTunnelPayloadType::DEFAULT,
29879 target_system: 0_u8,
29880 target_component: 0_u8,
29881 payload_length: 0_u8,
29882 payload: [0_u8; 128usize],
29883 };
29884 #[cfg(feature = "arbitrary")]
29885 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
29886 use arbitrary::{Arbitrary, Unstructured};
29887 let mut buf = [0u8; 1024];
29888 rng.fill_bytes(&mut buf);
29889 let mut unstructured = Unstructured::new(&buf);
29890 Self::arbitrary(&mut unstructured).unwrap_or_default()
29891 }
29892}
29893impl Default for TUNNEL_DATA {
29894 fn default() -> Self {
29895 Self::DEFAULT.clone()
29896 }
29897}
29898impl MessageData for TUNNEL_DATA {
29899 type Message = MavMessage;
29900 const ID: u32 = 385u32;
29901 const NAME: &'static str = "TUNNEL";
29902 const EXTRA_CRC: u8 = 147u8;
29903 const ENCODED_LEN: usize = 133usize;
29904 fn deser(
29905 _version: MavlinkVersion,
29906 __input: &[u8],
29907 ) -> Result<Self, ::mavlink_core::error::ParserError> {
29908 let avail_len = __input.len();
29909 let mut payload_buf = [0; Self::ENCODED_LEN];
29910 let mut buf = if avail_len < Self::ENCODED_LEN {
29911 payload_buf[0..avail_len].copy_from_slice(__input);
29912 Bytes::new(&payload_buf)
29913 } else {
29914 Bytes::new(__input)
29915 };
29916 let mut __struct = Self::default();
29917 let tmp = buf.get_u16_le();
29918 __struct.payload_type = FromPrimitive::from_u16(tmp).ok_or(
29919 ::mavlink_core::error::ParserError::InvalidEnum {
29920 enum_type: "MavTunnelPayloadType",
29921 value: tmp as u32,
29922 },
29923 )?;
29924 __struct.target_system = buf.get_u8();
29925 __struct.target_component = buf.get_u8();
29926 __struct.payload_length = buf.get_u8();
29927 for v in &mut __struct.payload {
29928 let val = buf.get_u8();
29929 *v = val;
29930 }
29931 Ok(__struct)
29932 }
29933 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
29934 let mut __tmp = BytesMut::new(bytes);
29935 #[allow(clippy::absurd_extreme_comparisons)]
29936 #[allow(unused_comparisons)]
29937 if __tmp.remaining() < Self::ENCODED_LEN {
29938 panic!(
29939 "buffer is too small (need {} bytes, but got {})",
29940 Self::ENCODED_LEN,
29941 __tmp.remaining(),
29942 )
29943 }
29944 __tmp.put_u16_le(self.payload_type as u16);
29945 __tmp.put_u8(self.target_system);
29946 __tmp.put_u8(self.target_component);
29947 __tmp.put_u8(self.payload_length);
29948 for val in &self.payload {
29949 __tmp.put_u8(*val);
29950 }
29951 if matches!(version, MavlinkVersion::V2) {
29952 let len = __tmp.len();
29953 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
29954 } else {
29955 __tmp.len()
29956 }
29957 }
29958}
29959#[doc = "General information describing a particular UAVCAN node. Please refer to the definition of the UAVCAN service \"uavcan.protocol.GetNodeInfo\" for the background information. This message should be emitted by the system whenever a new node appears online, or an existing node reboots. Additionally, it can be emitted upon request from the other end of the MAVLink channel (see MAV_CMD_UAVCAN_GET_NODE_INFO). It is also not prohibited to emit this message unconditionally at a low frequency. The UAVCAN specification is available at <http://uavcan.org>."]
29960#[doc = ""]
29961#[doc = "ID: 311"]
29962#[derive(Debug, Clone, PartialEq)]
29963#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
29964#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
29965pub struct UAVCAN_NODE_INFO_DATA {
29966 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
29967 pub time_usec: u64,
29968 #[doc = "Time since the start-up of the node."]
29969 pub uptime_sec: u32,
29970 #[doc = "Version control system (VCS) revision identifier (e.g. git short commit hash). 0 if unknown."]
29971 pub sw_vcs_commit: u32,
29972 #[doc = "Node name string. For example, \"sapog.px4.io\"."]
29973 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
29974 pub name: [u8; 80],
29975 #[doc = "Hardware major version number."]
29976 pub hw_version_major: u8,
29977 #[doc = "Hardware minor version number."]
29978 pub hw_version_minor: u8,
29979 #[doc = "Hardware unique 128-bit ID."]
29980 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
29981 pub hw_unique_id: [u8; 16],
29982 #[doc = "Software major version number."]
29983 pub sw_version_major: u8,
29984 #[doc = "Software minor version number."]
29985 pub sw_version_minor: u8,
29986}
29987impl UAVCAN_NODE_INFO_DATA {
29988 pub const ENCODED_LEN: usize = 116usize;
29989 pub const DEFAULT: Self = Self {
29990 time_usec: 0_u64,
29991 uptime_sec: 0_u32,
29992 sw_vcs_commit: 0_u32,
29993 name: [0_u8; 80usize],
29994 hw_version_major: 0_u8,
29995 hw_version_minor: 0_u8,
29996 hw_unique_id: [0_u8; 16usize],
29997 sw_version_major: 0_u8,
29998 sw_version_minor: 0_u8,
29999 };
30000 #[cfg(feature = "arbitrary")]
30001 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
30002 use arbitrary::{Arbitrary, Unstructured};
30003 let mut buf = [0u8; 1024];
30004 rng.fill_bytes(&mut buf);
30005 let mut unstructured = Unstructured::new(&buf);
30006 Self::arbitrary(&mut unstructured).unwrap_or_default()
30007 }
30008}
30009impl Default for UAVCAN_NODE_INFO_DATA {
30010 fn default() -> Self {
30011 Self::DEFAULT.clone()
30012 }
30013}
30014impl MessageData for UAVCAN_NODE_INFO_DATA {
30015 type Message = MavMessage;
30016 const ID: u32 = 311u32;
30017 const NAME: &'static str = "UAVCAN_NODE_INFO";
30018 const EXTRA_CRC: u8 = 95u8;
30019 const ENCODED_LEN: usize = 116usize;
30020 fn deser(
30021 _version: MavlinkVersion,
30022 __input: &[u8],
30023 ) -> Result<Self, ::mavlink_core::error::ParserError> {
30024 let avail_len = __input.len();
30025 let mut payload_buf = [0; Self::ENCODED_LEN];
30026 let mut buf = if avail_len < Self::ENCODED_LEN {
30027 payload_buf[0..avail_len].copy_from_slice(__input);
30028 Bytes::new(&payload_buf)
30029 } else {
30030 Bytes::new(__input)
30031 };
30032 let mut __struct = Self::default();
30033 __struct.time_usec = buf.get_u64_le();
30034 __struct.uptime_sec = buf.get_u32_le();
30035 __struct.sw_vcs_commit = buf.get_u32_le();
30036 for v in &mut __struct.name {
30037 let val = buf.get_u8();
30038 *v = val;
30039 }
30040 __struct.hw_version_major = buf.get_u8();
30041 __struct.hw_version_minor = buf.get_u8();
30042 for v in &mut __struct.hw_unique_id {
30043 let val = buf.get_u8();
30044 *v = val;
30045 }
30046 __struct.sw_version_major = buf.get_u8();
30047 __struct.sw_version_minor = buf.get_u8();
30048 Ok(__struct)
30049 }
30050 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
30051 let mut __tmp = BytesMut::new(bytes);
30052 #[allow(clippy::absurd_extreme_comparisons)]
30053 #[allow(unused_comparisons)]
30054 if __tmp.remaining() < Self::ENCODED_LEN {
30055 panic!(
30056 "buffer is too small (need {} bytes, but got {})",
30057 Self::ENCODED_LEN,
30058 __tmp.remaining(),
30059 )
30060 }
30061 __tmp.put_u64_le(self.time_usec);
30062 __tmp.put_u32_le(self.uptime_sec);
30063 __tmp.put_u32_le(self.sw_vcs_commit);
30064 for val in &self.name {
30065 __tmp.put_u8(*val);
30066 }
30067 __tmp.put_u8(self.hw_version_major);
30068 __tmp.put_u8(self.hw_version_minor);
30069 for val in &self.hw_unique_id {
30070 __tmp.put_u8(*val);
30071 }
30072 __tmp.put_u8(self.sw_version_major);
30073 __tmp.put_u8(self.sw_version_minor);
30074 if matches!(version, MavlinkVersion::V2) {
30075 let len = __tmp.len();
30076 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
30077 } else {
30078 __tmp.len()
30079 }
30080 }
30081}
30082#[doc = "General status information of an UAVCAN node. Please refer to the definition of the UAVCAN message \"uavcan.protocol.NodeStatus\" for the background information. The UAVCAN specification is available at <http://uavcan.org>."]
30083#[doc = ""]
30084#[doc = "ID: 310"]
30085#[derive(Debug, Clone, PartialEq)]
30086#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
30087#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
30088pub struct UAVCAN_NODE_STATUS_DATA {
30089 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
30090 pub time_usec: u64,
30091 #[doc = "Time since the start-up of the node."]
30092 pub uptime_sec: u32,
30093 #[doc = "Vendor-specific status information."]
30094 pub vendor_specific_status_code: u16,
30095 #[doc = "Generalized node health status."]
30096 pub health: UavcanNodeHealth,
30097 #[doc = "Generalized operating mode."]
30098 pub mode: UavcanNodeMode,
30099 #[doc = "Not used currently."]
30100 pub sub_mode: u8,
30101}
30102impl UAVCAN_NODE_STATUS_DATA {
30103 pub const ENCODED_LEN: usize = 17usize;
30104 pub const DEFAULT: Self = Self {
30105 time_usec: 0_u64,
30106 uptime_sec: 0_u32,
30107 vendor_specific_status_code: 0_u16,
30108 health: UavcanNodeHealth::DEFAULT,
30109 mode: UavcanNodeMode::DEFAULT,
30110 sub_mode: 0_u8,
30111 };
30112 #[cfg(feature = "arbitrary")]
30113 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
30114 use arbitrary::{Arbitrary, Unstructured};
30115 let mut buf = [0u8; 1024];
30116 rng.fill_bytes(&mut buf);
30117 let mut unstructured = Unstructured::new(&buf);
30118 Self::arbitrary(&mut unstructured).unwrap_or_default()
30119 }
30120}
30121impl Default for UAVCAN_NODE_STATUS_DATA {
30122 fn default() -> Self {
30123 Self::DEFAULT.clone()
30124 }
30125}
30126impl MessageData for UAVCAN_NODE_STATUS_DATA {
30127 type Message = MavMessage;
30128 const ID: u32 = 310u32;
30129 const NAME: &'static str = "UAVCAN_NODE_STATUS";
30130 const EXTRA_CRC: u8 = 28u8;
30131 const ENCODED_LEN: usize = 17usize;
30132 fn deser(
30133 _version: MavlinkVersion,
30134 __input: &[u8],
30135 ) -> Result<Self, ::mavlink_core::error::ParserError> {
30136 let avail_len = __input.len();
30137 let mut payload_buf = [0; Self::ENCODED_LEN];
30138 let mut buf = if avail_len < Self::ENCODED_LEN {
30139 payload_buf[0..avail_len].copy_from_slice(__input);
30140 Bytes::new(&payload_buf)
30141 } else {
30142 Bytes::new(__input)
30143 };
30144 let mut __struct = Self::default();
30145 __struct.time_usec = buf.get_u64_le();
30146 __struct.uptime_sec = buf.get_u32_le();
30147 __struct.vendor_specific_status_code = buf.get_u16_le();
30148 let tmp = buf.get_u8();
30149 __struct.health =
30150 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
30151 enum_type: "UavcanNodeHealth",
30152 value: tmp as u32,
30153 })?;
30154 let tmp = buf.get_u8();
30155 __struct.mode =
30156 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
30157 enum_type: "UavcanNodeMode",
30158 value: tmp as u32,
30159 })?;
30160 __struct.sub_mode = buf.get_u8();
30161 Ok(__struct)
30162 }
30163 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
30164 let mut __tmp = BytesMut::new(bytes);
30165 #[allow(clippy::absurd_extreme_comparisons)]
30166 #[allow(unused_comparisons)]
30167 if __tmp.remaining() < Self::ENCODED_LEN {
30168 panic!(
30169 "buffer is too small (need {} bytes, but got {})",
30170 Self::ENCODED_LEN,
30171 __tmp.remaining(),
30172 )
30173 }
30174 __tmp.put_u64_le(self.time_usec);
30175 __tmp.put_u32_le(self.uptime_sec);
30176 __tmp.put_u16_le(self.vendor_specific_status_code);
30177 __tmp.put_u8(self.health as u8);
30178 __tmp.put_u8(self.mode as u8);
30179 __tmp.put_u8(self.sub_mode);
30180 if matches!(version, MavlinkVersion::V2) {
30181 let len = __tmp.len();
30182 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
30183 } else {
30184 __tmp.len()
30185 }
30186 }
30187}
30188#[doc = "The global position resulting from GPS and sensor fusion."]
30189#[doc = ""]
30190#[doc = "ID: 340"]
30191#[derive(Debug, Clone, PartialEq)]
30192#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
30193#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
30194pub struct UTM_GLOBAL_POSITION_DATA {
30195 #[doc = "Time of applicability of position (microseconds since UNIX epoch)."]
30196 pub time: u64,
30197 #[doc = "Latitude (WGS84)"]
30198 pub lat: i32,
30199 #[doc = "Longitude (WGS84)"]
30200 pub lon: i32,
30201 #[doc = "Altitude (WGS84)"]
30202 pub alt: i32,
30203 #[doc = "Altitude above ground"]
30204 pub relative_alt: i32,
30205 #[doc = "Next waypoint, latitude (WGS84)"]
30206 pub next_lat: i32,
30207 #[doc = "Next waypoint, longitude (WGS84)"]
30208 pub next_lon: i32,
30209 #[doc = "Next waypoint, altitude (WGS84)"]
30210 pub next_alt: i32,
30211 #[doc = "Ground X speed (latitude, positive north)"]
30212 pub vx: i16,
30213 #[doc = "Ground Y speed (longitude, positive east)"]
30214 pub vy: i16,
30215 #[doc = "Ground Z speed (altitude, positive down)"]
30216 pub vz: i16,
30217 #[doc = "Horizontal position uncertainty (standard deviation)"]
30218 pub h_acc: u16,
30219 #[doc = "Altitude uncertainty (standard deviation)"]
30220 pub v_acc: u16,
30221 #[doc = "Speed uncertainty (standard deviation)"]
30222 pub vel_acc: u16,
30223 #[doc = "Time until next update. Set to 0 if unknown or in data driven mode."]
30224 pub update_rate: u16,
30225 #[doc = "Unique UAS ID."]
30226 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
30227 pub uas_id: [u8; 18],
30228 #[doc = "Flight state"]
30229 pub flight_state: UtmFlightState,
30230 #[doc = "Bitwise OR combination of the data available flags."]
30231 pub flags: UtmDataAvailFlags,
30232}
30233impl UTM_GLOBAL_POSITION_DATA {
30234 pub const ENCODED_LEN: usize = 70usize;
30235 pub const DEFAULT: Self = Self {
30236 time: 0_u64,
30237 lat: 0_i32,
30238 lon: 0_i32,
30239 alt: 0_i32,
30240 relative_alt: 0_i32,
30241 next_lat: 0_i32,
30242 next_lon: 0_i32,
30243 next_alt: 0_i32,
30244 vx: 0_i16,
30245 vy: 0_i16,
30246 vz: 0_i16,
30247 h_acc: 0_u16,
30248 v_acc: 0_u16,
30249 vel_acc: 0_u16,
30250 update_rate: 0_u16,
30251 uas_id: [0_u8; 18usize],
30252 flight_state: UtmFlightState::DEFAULT,
30253 flags: UtmDataAvailFlags::DEFAULT,
30254 };
30255 #[cfg(feature = "arbitrary")]
30256 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
30257 use arbitrary::{Arbitrary, Unstructured};
30258 let mut buf = [0u8; 1024];
30259 rng.fill_bytes(&mut buf);
30260 let mut unstructured = Unstructured::new(&buf);
30261 Self::arbitrary(&mut unstructured).unwrap_or_default()
30262 }
30263}
30264impl Default for UTM_GLOBAL_POSITION_DATA {
30265 fn default() -> Self {
30266 Self::DEFAULT.clone()
30267 }
30268}
30269impl MessageData for UTM_GLOBAL_POSITION_DATA {
30270 type Message = MavMessage;
30271 const ID: u32 = 340u32;
30272 const NAME: &'static str = "UTM_GLOBAL_POSITION";
30273 const EXTRA_CRC: u8 = 99u8;
30274 const ENCODED_LEN: usize = 70usize;
30275 fn deser(
30276 _version: MavlinkVersion,
30277 __input: &[u8],
30278 ) -> Result<Self, ::mavlink_core::error::ParserError> {
30279 let avail_len = __input.len();
30280 let mut payload_buf = [0; Self::ENCODED_LEN];
30281 let mut buf = if avail_len < Self::ENCODED_LEN {
30282 payload_buf[0..avail_len].copy_from_slice(__input);
30283 Bytes::new(&payload_buf)
30284 } else {
30285 Bytes::new(__input)
30286 };
30287 let mut __struct = Self::default();
30288 __struct.time = buf.get_u64_le();
30289 __struct.lat = buf.get_i32_le();
30290 __struct.lon = buf.get_i32_le();
30291 __struct.alt = buf.get_i32_le();
30292 __struct.relative_alt = buf.get_i32_le();
30293 __struct.next_lat = buf.get_i32_le();
30294 __struct.next_lon = buf.get_i32_le();
30295 __struct.next_alt = buf.get_i32_le();
30296 __struct.vx = buf.get_i16_le();
30297 __struct.vy = buf.get_i16_le();
30298 __struct.vz = buf.get_i16_le();
30299 __struct.h_acc = buf.get_u16_le();
30300 __struct.v_acc = buf.get_u16_le();
30301 __struct.vel_acc = buf.get_u16_le();
30302 __struct.update_rate = buf.get_u16_le();
30303 for v in &mut __struct.uas_id {
30304 let val = buf.get_u8();
30305 *v = val;
30306 }
30307 let tmp = buf.get_u8();
30308 __struct.flight_state =
30309 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
30310 enum_type: "UtmFlightState",
30311 value: tmp as u32,
30312 })?;
30313 let tmp = buf.get_u8();
30314 __struct.flags = UtmDataAvailFlags::from_bits(tmp & UtmDataAvailFlags::all().bits())
30315 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
30316 flag_type: "UtmDataAvailFlags",
30317 value: tmp as u32,
30318 })?;
30319 Ok(__struct)
30320 }
30321 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
30322 let mut __tmp = BytesMut::new(bytes);
30323 #[allow(clippy::absurd_extreme_comparisons)]
30324 #[allow(unused_comparisons)]
30325 if __tmp.remaining() < Self::ENCODED_LEN {
30326 panic!(
30327 "buffer is too small (need {} bytes, but got {})",
30328 Self::ENCODED_LEN,
30329 __tmp.remaining(),
30330 )
30331 }
30332 __tmp.put_u64_le(self.time);
30333 __tmp.put_i32_le(self.lat);
30334 __tmp.put_i32_le(self.lon);
30335 __tmp.put_i32_le(self.alt);
30336 __tmp.put_i32_le(self.relative_alt);
30337 __tmp.put_i32_le(self.next_lat);
30338 __tmp.put_i32_le(self.next_lon);
30339 __tmp.put_i32_le(self.next_alt);
30340 __tmp.put_i16_le(self.vx);
30341 __tmp.put_i16_le(self.vy);
30342 __tmp.put_i16_le(self.vz);
30343 __tmp.put_u16_le(self.h_acc);
30344 __tmp.put_u16_le(self.v_acc);
30345 __tmp.put_u16_le(self.vel_acc);
30346 __tmp.put_u16_le(self.update_rate);
30347 for val in &self.uas_id {
30348 __tmp.put_u8(*val);
30349 }
30350 __tmp.put_u8(self.flight_state as u8);
30351 __tmp.put_u8(self.flags.bits());
30352 if matches!(version, MavlinkVersion::V2) {
30353 let len = __tmp.len();
30354 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
30355 } else {
30356 __tmp.len()
30357 }
30358 }
30359}
30360#[doc = "Message implementing parts of the V2 payload specs in V1 frames for transitional support."]
30361#[doc = ""]
30362#[doc = "ID: 248"]
30363#[derive(Debug, Clone, PartialEq)]
30364#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
30365#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
30366pub struct V2_EXTENSION_DATA {
30367 #[doc = "A code that identifies the software component that understands this message (analogous to USB device classes or mime type strings). If this code is less than 32768, it is considered a 'registered' protocol extension and the corresponding entry should be added to <https://github.com/mavlink/mavlink/definition_files/extension_message_ids.xml>. Software creators can register blocks of message IDs as needed (useful for GCS specific metadata, etc...). Message_types greater than 32767 are considered local experiments and should not be checked in to any widely distributed codebase."]
30368 pub message_type: u16,
30369 #[doc = "Network ID (0 for broadcast)"]
30370 pub target_network: u8,
30371 #[doc = "System ID (0 for broadcast)"]
30372 pub target_system: u8,
30373 #[doc = "Component ID (0 for broadcast)"]
30374 pub target_component: u8,
30375 #[doc = "Variable length payload. The length must be encoded in the payload as part of the message_type protocol, e.g. by including the length as payload data, or by terminating the payload data with a non-zero marker. This is required in order to reconstruct zero-terminated payloads that are (or otherwise would be) trimmed by MAVLink 2 empty-byte truncation. The entire content of the payload block is opaque unless you understand the encoding message_type. The particular encoding used can be extension specific and might not always be documented as part of the MAVLink specification."]
30376 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
30377 pub payload: [u8; 249],
30378}
30379impl V2_EXTENSION_DATA {
30380 pub const ENCODED_LEN: usize = 254usize;
30381 pub const DEFAULT: Self = Self {
30382 message_type: 0_u16,
30383 target_network: 0_u8,
30384 target_system: 0_u8,
30385 target_component: 0_u8,
30386 payload: [0_u8; 249usize],
30387 };
30388 #[cfg(feature = "arbitrary")]
30389 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
30390 use arbitrary::{Arbitrary, Unstructured};
30391 let mut buf = [0u8; 1024];
30392 rng.fill_bytes(&mut buf);
30393 let mut unstructured = Unstructured::new(&buf);
30394 Self::arbitrary(&mut unstructured).unwrap_or_default()
30395 }
30396}
30397impl Default for V2_EXTENSION_DATA {
30398 fn default() -> Self {
30399 Self::DEFAULT.clone()
30400 }
30401}
30402impl MessageData for V2_EXTENSION_DATA {
30403 type Message = MavMessage;
30404 const ID: u32 = 248u32;
30405 const NAME: &'static str = "V2_EXTENSION";
30406 const EXTRA_CRC: u8 = 8u8;
30407 const ENCODED_LEN: usize = 254usize;
30408 fn deser(
30409 _version: MavlinkVersion,
30410 __input: &[u8],
30411 ) -> Result<Self, ::mavlink_core::error::ParserError> {
30412 let avail_len = __input.len();
30413 let mut payload_buf = [0; Self::ENCODED_LEN];
30414 let mut buf = if avail_len < Self::ENCODED_LEN {
30415 payload_buf[0..avail_len].copy_from_slice(__input);
30416 Bytes::new(&payload_buf)
30417 } else {
30418 Bytes::new(__input)
30419 };
30420 let mut __struct = Self::default();
30421 __struct.message_type = buf.get_u16_le();
30422 __struct.target_network = buf.get_u8();
30423 __struct.target_system = buf.get_u8();
30424 __struct.target_component = buf.get_u8();
30425 for v in &mut __struct.payload {
30426 let val = buf.get_u8();
30427 *v = val;
30428 }
30429 Ok(__struct)
30430 }
30431 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
30432 let mut __tmp = BytesMut::new(bytes);
30433 #[allow(clippy::absurd_extreme_comparisons)]
30434 #[allow(unused_comparisons)]
30435 if __tmp.remaining() < Self::ENCODED_LEN {
30436 panic!(
30437 "buffer is too small (need {} bytes, but got {})",
30438 Self::ENCODED_LEN,
30439 __tmp.remaining(),
30440 )
30441 }
30442 __tmp.put_u16_le(self.message_type);
30443 __tmp.put_u8(self.target_network);
30444 __tmp.put_u8(self.target_system);
30445 __tmp.put_u8(self.target_component);
30446 for val in &self.payload {
30447 __tmp.put_u8(*val);
30448 }
30449 if matches!(version, MavlinkVersion::V2) {
30450 let len = __tmp.len();
30451 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
30452 } else {
30453 __tmp.len()
30454 }
30455 }
30456}
30457#[doc = "Metrics typically displayed on a HUD for fixed wing aircraft."]
30458#[doc = ""]
30459#[doc = "ID: 74"]
30460#[derive(Debug, Clone, PartialEq)]
30461#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
30462#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
30463pub struct VFR_HUD_DATA {
30464 #[doc = "Vehicle speed in form appropriate for vehicle type. For standard aircraft this is typically calibrated airspeed (CAS) or indicated airspeed (IAS) - either of which can be used by a pilot to estimate stall speed."]
30465 pub airspeed: f32,
30466 #[doc = "Current ground speed."]
30467 pub groundspeed: f32,
30468 #[doc = "Current altitude (MSL)."]
30469 pub alt: f32,
30470 #[doc = "Current climb rate."]
30471 pub climb: f32,
30472 #[doc = "Current heading in compass units (0-360, 0=north)."]
30473 pub heading: i16,
30474 #[doc = "Current throttle setting (0 to 100)."]
30475 pub throttle: u16,
30476}
30477impl VFR_HUD_DATA {
30478 pub const ENCODED_LEN: usize = 20usize;
30479 pub const DEFAULT: Self = Self {
30480 airspeed: 0.0_f32,
30481 groundspeed: 0.0_f32,
30482 alt: 0.0_f32,
30483 climb: 0.0_f32,
30484 heading: 0_i16,
30485 throttle: 0_u16,
30486 };
30487 #[cfg(feature = "arbitrary")]
30488 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
30489 use arbitrary::{Arbitrary, Unstructured};
30490 let mut buf = [0u8; 1024];
30491 rng.fill_bytes(&mut buf);
30492 let mut unstructured = Unstructured::new(&buf);
30493 Self::arbitrary(&mut unstructured).unwrap_or_default()
30494 }
30495}
30496impl Default for VFR_HUD_DATA {
30497 fn default() -> Self {
30498 Self::DEFAULT.clone()
30499 }
30500}
30501impl MessageData for VFR_HUD_DATA {
30502 type Message = MavMessage;
30503 const ID: u32 = 74u32;
30504 const NAME: &'static str = "VFR_HUD";
30505 const EXTRA_CRC: u8 = 20u8;
30506 const ENCODED_LEN: usize = 20usize;
30507 fn deser(
30508 _version: MavlinkVersion,
30509 __input: &[u8],
30510 ) -> Result<Self, ::mavlink_core::error::ParserError> {
30511 let avail_len = __input.len();
30512 let mut payload_buf = [0; Self::ENCODED_LEN];
30513 let mut buf = if avail_len < Self::ENCODED_LEN {
30514 payload_buf[0..avail_len].copy_from_slice(__input);
30515 Bytes::new(&payload_buf)
30516 } else {
30517 Bytes::new(__input)
30518 };
30519 let mut __struct = Self::default();
30520 __struct.airspeed = buf.get_f32_le();
30521 __struct.groundspeed = buf.get_f32_le();
30522 __struct.alt = buf.get_f32_le();
30523 __struct.climb = buf.get_f32_le();
30524 __struct.heading = buf.get_i16_le();
30525 __struct.throttle = buf.get_u16_le();
30526 Ok(__struct)
30527 }
30528 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
30529 let mut __tmp = BytesMut::new(bytes);
30530 #[allow(clippy::absurd_extreme_comparisons)]
30531 #[allow(unused_comparisons)]
30532 if __tmp.remaining() < Self::ENCODED_LEN {
30533 panic!(
30534 "buffer is too small (need {} bytes, but got {})",
30535 Self::ENCODED_LEN,
30536 __tmp.remaining(),
30537 )
30538 }
30539 __tmp.put_f32_le(self.airspeed);
30540 __tmp.put_f32_le(self.groundspeed);
30541 __tmp.put_f32_le(self.alt);
30542 __tmp.put_f32_le(self.climb);
30543 __tmp.put_i16_le(self.heading);
30544 __tmp.put_u16_le(self.throttle);
30545 if matches!(version, MavlinkVersion::V2) {
30546 let len = __tmp.len();
30547 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
30548 } else {
30549 __tmp.len()
30550 }
30551 }
30552}
30553#[doc = "Vibration levels and accelerometer clipping."]
30554#[doc = ""]
30555#[doc = "ID: 241"]
30556#[derive(Debug, Clone, PartialEq)]
30557#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
30558#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
30559pub struct VIBRATION_DATA {
30560 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
30561 pub time_usec: u64,
30562 #[doc = "Vibration levels on X-axis"]
30563 pub vibration_x: f32,
30564 #[doc = "Vibration levels on Y-axis"]
30565 pub vibration_y: f32,
30566 #[doc = "Vibration levels on Z-axis"]
30567 pub vibration_z: f32,
30568 #[doc = "first accelerometer clipping count"]
30569 pub clipping_0: u32,
30570 #[doc = "second accelerometer clipping count"]
30571 pub clipping_1: u32,
30572 #[doc = "third accelerometer clipping count"]
30573 pub clipping_2: u32,
30574}
30575impl VIBRATION_DATA {
30576 pub const ENCODED_LEN: usize = 32usize;
30577 pub const DEFAULT: Self = Self {
30578 time_usec: 0_u64,
30579 vibration_x: 0.0_f32,
30580 vibration_y: 0.0_f32,
30581 vibration_z: 0.0_f32,
30582 clipping_0: 0_u32,
30583 clipping_1: 0_u32,
30584 clipping_2: 0_u32,
30585 };
30586 #[cfg(feature = "arbitrary")]
30587 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
30588 use arbitrary::{Arbitrary, Unstructured};
30589 let mut buf = [0u8; 1024];
30590 rng.fill_bytes(&mut buf);
30591 let mut unstructured = Unstructured::new(&buf);
30592 Self::arbitrary(&mut unstructured).unwrap_or_default()
30593 }
30594}
30595impl Default for VIBRATION_DATA {
30596 fn default() -> Self {
30597 Self::DEFAULT.clone()
30598 }
30599}
30600impl MessageData for VIBRATION_DATA {
30601 type Message = MavMessage;
30602 const ID: u32 = 241u32;
30603 const NAME: &'static str = "VIBRATION";
30604 const EXTRA_CRC: u8 = 90u8;
30605 const ENCODED_LEN: usize = 32usize;
30606 fn deser(
30607 _version: MavlinkVersion,
30608 __input: &[u8],
30609 ) -> Result<Self, ::mavlink_core::error::ParserError> {
30610 let avail_len = __input.len();
30611 let mut payload_buf = [0; Self::ENCODED_LEN];
30612 let mut buf = if avail_len < Self::ENCODED_LEN {
30613 payload_buf[0..avail_len].copy_from_slice(__input);
30614 Bytes::new(&payload_buf)
30615 } else {
30616 Bytes::new(__input)
30617 };
30618 let mut __struct = Self::default();
30619 __struct.time_usec = buf.get_u64_le();
30620 __struct.vibration_x = buf.get_f32_le();
30621 __struct.vibration_y = buf.get_f32_le();
30622 __struct.vibration_z = buf.get_f32_le();
30623 __struct.clipping_0 = buf.get_u32_le();
30624 __struct.clipping_1 = buf.get_u32_le();
30625 __struct.clipping_2 = buf.get_u32_le();
30626 Ok(__struct)
30627 }
30628 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
30629 let mut __tmp = BytesMut::new(bytes);
30630 #[allow(clippy::absurd_extreme_comparisons)]
30631 #[allow(unused_comparisons)]
30632 if __tmp.remaining() < Self::ENCODED_LEN {
30633 panic!(
30634 "buffer is too small (need {} bytes, but got {})",
30635 Self::ENCODED_LEN,
30636 __tmp.remaining(),
30637 )
30638 }
30639 __tmp.put_u64_le(self.time_usec);
30640 __tmp.put_f32_le(self.vibration_x);
30641 __tmp.put_f32_le(self.vibration_y);
30642 __tmp.put_f32_le(self.vibration_z);
30643 __tmp.put_u32_le(self.clipping_0);
30644 __tmp.put_u32_le(self.clipping_1);
30645 __tmp.put_u32_le(self.clipping_2);
30646 if matches!(version, MavlinkVersion::V2) {
30647 let len = __tmp.len();
30648 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
30649 } else {
30650 __tmp.len()
30651 }
30652 }
30653}
30654#[doc = "Global position estimate from a Vicon motion system source."]
30655#[doc = ""]
30656#[doc = "ID: 104"]
30657#[derive(Debug, Clone, PartialEq)]
30658#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
30659#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
30660pub struct VICON_POSITION_ESTIMATE_DATA {
30661 #[doc = "Timestamp (UNIX time or time since system boot)"]
30662 pub usec: u64,
30663 #[doc = "Global X position"]
30664 pub x: f32,
30665 #[doc = "Global Y position"]
30666 pub y: f32,
30667 #[doc = "Global Z position"]
30668 pub z: f32,
30669 #[doc = "Roll angle"]
30670 pub roll: f32,
30671 #[doc = "Pitch angle"]
30672 pub pitch: f32,
30673 #[doc = "Yaw angle"]
30674 pub yaw: f32,
30675 #[doc = "Row-major representation of 6x6 pose cross-covariance matrix upper right triangle (states: x, y, z, roll, pitch, yaw; first six entries are the first ROW, next five entries are the second ROW, etc.). If unknown, assign NaN value to first element in the array."]
30676 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
30677 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
30678 pub covariance: [f32; 21],
30679}
30680impl VICON_POSITION_ESTIMATE_DATA {
30681 pub const ENCODED_LEN: usize = 116usize;
30682 pub const DEFAULT: Self = Self {
30683 usec: 0_u64,
30684 x: 0.0_f32,
30685 y: 0.0_f32,
30686 z: 0.0_f32,
30687 roll: 0.0_f32,
30688 pitch: 0.0_f32,
30689 yaw: 0.0_f32,
30690 covariance: [0.0_f32; 21usize],
30691 };
30692 #[cfg(feature = "arbitrary")]
30693 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
30694 use arbitrary::{Arbitrary, Unstructured};
30695 let mut buf = [0u8; 1024];
30696 rng.fill_bytes(&mut buf);
30697 let mut unstructured = Unstructured::new(&buf);
30698 Self::arbitrary(&mut unstructured).unwrap_or_default()
30699 }
30700}
30701impl Default for VICON_POSITION_ESTIMATE_DATA {
30702 fn default() -> Self {
30703 Self::DEFAULT.clone()
30704 }
30705}
30706impl MessageData for VICON_POSITION_ESTIMATE_DATA {
30707 type Message = MavMessage;
30708 const ID: u32 = 104u32;
30709 const NAME: &'static str = "VICON_POSITION_ESTIMATE";
30710 const EXTRA_CRC: u8 = 56u8;
30711 const ENCODED_LEN: usize = 116usize;
30712 fn deser(
30713 _version: MavlinkVersion,
30714 __input: &[u8],
30715 ) -> Result<Self, ::mavlink_core::error::ParserError> {
30716 let avail_len = __input.len();
30717 let mut payload_buf = [0; Self::ENCODED_LEN];
30718 let mut buf = if avail_len < Self::ENCODED_LEN {
30719 payload_buf[0..avail_len].copy_from_slice(__input);
30720 Bytes::new(&payload_buf)
30721 } else {
30722 Bytes::new(__input)
30723 };
30724 let mut __struct = Self::default();
30725 __struct.usec = buf.get_u64_le();
30726 __struct.x = buf.get_f32_le();
30727 __struct.y = buf.get_f32_le();
30728 __struct.z = buf.get_f32_le();
30729 __struct.roll = buf.get_f32_le();
30730 __struct.pitch = buf.get_f32_le();
30731 __struct.yaw = buf.get_f32_le();
30732 for v in &mut __struct.covariance {
30733 let val = buf.get_f32_le();
30734 *v = val;
30735 }
30736 Ok(__struct)
30737 }
30738 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
30739 let mut __tmp = BytesMut::new(bytes);
30740 #[allow(clippy::absurd_extreme_comparisons)]
30741 #[allow(unused_comparisons)]
30742 if __tmp.remaining() < Self::ENCODED_LEN {
30743 panic!(
30744 "buffer is too small (need {} bytes, but got {})",
30745 Self::ENCODED_LEN,
30746 __tmp.remaining(),
30747 )
30748 }
30749 __tmp.put_u64_le(self.usec);
30750 __tmp.put_f32_le(self.x);
30751 __tmp.put_f32_le(self.y);
30752 __tmp.put_f32_le(self.z);
30753 __tmp.put_f32_le(self.roll);
30754 __tmp.put_f32_le(self.pitch);
30755 __tmp.put_f32_le(self.yaw);
30756 if matches!(version, MavlinkVersion::V2) {
30757 for val in &self.covariance {
30758 __tmp.put_f32_le(*val);
30759 }
30760 let len = __tmp.len();
30761 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
30762 } else {
30763 __tmp.len()
30764 }
30765 }
30766}
30767#[doc = "Information about video stream. It may be requested using MAV_CMD_REQUEST_MESSAGE, where param2 indicates the video stream id: 0 for all streams, 1 for first, 2 for second, etc."]
30768#[doc = ""]
30769#[doc = "ID: 269"]
30770#[derive(Debug, Clone, PartialEq)]
30771#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
30772#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
30773pub struct VIDEO_STREAM_INFORMATION_DATA {
30774 #[doc = "Frame rate."]
30775 pub framerate: f32,
30776 #[doc = "Bit rate."]
30777 pub bitrate: u32,
30778 #[doc = "Bitmap of stream status flags."]
30779 pub flags: VideoStreamStatusFlags,
30780 #[doc = "Horizontal resolution."]
30781 pub resolution_h: u16,
30782 #[doc = "Vertical resolution."]
30783 pub resolution_v: u16,
30784 #[doc = "Video image rotation clockwise."]
30785 pub rotation: u16,
30786 #[doc = "Horizontal Field of view."]
30787 pub hfov: u16,
30788 #[doc = "Video Stream ID (1 for first, 2 for second, etc.)"]
30789 pub stream_id: u8,
30790 #[doc = "Number of streams available."]
30791 pub count: u8,
30792 #[doc = "Type of stream."]
30793 pub mavtype: VideoStreamType,
30794 #[doc = "Stream name."]
30795 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
30796 pub name: [u8; 32],
30797 #[doc = "Video stream URI (TCP or RTSP URI ground station should connect to) or port number (UDP port ground station should listen to)."]
30798 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
30799 pub uri: [u8; 160],
30800 #[doc = "Encoding of stream."]
30801 #[cfg_attr(feature = "serde", serde(default))]
30802 pub encoding: VideoStreamEncoding,
30803 #[doc = "Camera id of a non-MAVLink camera attached to an autopilot (1-6). 0 if the component is a MAVLink camera (with its own component id)."]
30804 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
30805 pub camera_device_id: u8,
30806}
30807impl VIDEO_STREAM_INFORMATION_DATA {
30808 pub const ENCODED_LEN: usize = 215usize;
30809 pub const DEFAULT: Self = Self {
30810 framerate: 0.0_f32,
30811 bitrate: 0_u32,
30812 flags: VideoStreamStatusFlags::DEFAULT,
30813 resolution_h: 0_u16,
30814 resolution_v: 0_u16,
30815 rotation: 0_u16,
30816 hfov: 0_u16,
30817 stream_id: 0_u8,
30818 count: 0_u8,
30819 mavtype: VideoStreamType::DEFAULT,
30820 name: [0_u8; 32usize],
30821 uri: [0_u8; 160usize],
30822 encoding: VideoStreamEncoding::DEFAULT,
30823 camera_device_id: 0_u8,
30824 };
30825 #[cfg(feature = "arbitrary")]
30826 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
30827 use arbitrary::{Arbitrary, Unstructured};
30828 let mut buf = [0u8; 1024];
30829 rng.fill_bytes(&mut buf);
30830 let mut unstructured = Unstructured::new(&buf);
30831 Self::arbitrary(&mut unstructured).unwrap_or_default()
30832 }
30833}
30834impl Default for VIDEO_STREAM_INFORMATION_DATA {
30835 fn default() -> Self {
30836 Self::DEFAULT.clone()
30837 }
30838}
30839impl MessageData for VIDEO_STREAM_INFORMATION_DATA {
30840 type Message = MavMessage;
30841 const ID: u32 = 269u32;
30842 const NAME: &'static str = "VIDEO_STREAM_INFORMATION";
30843 const EXTRA_CRC: u8 = 109u8;
30844 const ENCODED_LEN: usize = 215usize;
30845 fn deser(
30846 _version: MavlinkVersion,
30847 __input: &[u8],
30848 ) -> Result<Self, ::mavlink_core::error::ParserError> {
30849 let avail_len = __input.len();
30850 let mut payload_buf = [0; Self::ENCODED_LEN];
30851 let mut buf = if avail_len < Self::ENCODED_LEN {
30852 payload_buf[0..avail_len].copy_from_slice(__input);
30853 Bytes::new(&payload_buf)
30854 } else {
30855 Bytes::new(__input)
30856 };
30857 let mut __struct = Self::default();
30858 __struct.framerate = buf.get_f32_le();
30859 __struct.bitrate = buf.get_u32_le();
30860 let tmp = buf.get_u16_le();
30861 __struct.flags = VideoStreamStatusFlags::from_bits(
30862 tmp & VideoStreamStatusFlags::all().bits(),
30863 )
30864 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
30865 flag_type: "VideoStreamStatusFlags",
30866 value: tmp as u32,
30867 })?;
30868 __struct.resolution_h = buf.get_u16_le();
30869 __struct.resolution_v = buf.get_u16_le();
30870 __struct.rotation = buf.get_u16_le();
30871 __struct.hfov = buf.get_u16_le();
30872 __struct.stream_id = buf.get_u8();
30873 __struct.count = buf.get_u8();
30874 let tmp = buf.get_u8();
30875 __struct.mavtype =
30876 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
30877 enum_type: "VideoStreamType",
30878 value: tmp as u32,
30879 })?;
30880 for v in &mut __struct.name {
30881 let val = buf.get_u8();
30882 *v = val;
30883 }
30884 for v in &mut __struct.uri {
30885 let val = buf.get_u8();
30886 *v = val;
30887 }
30888 let tmp = buf.get_u8();
30889 __struct.encoding =
30890 FromPrimitive::from_u8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
30891 enum_type: "VideoStreamEncoding",
30892 value: tmp as u32,
30893 })?;
30894 __struct.camera_device_id = buf.get_u8();
30895 Ok(__struct)
30896 }
30897 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
30898 let mut __tmp = BytesMut::new(bytes);
30899 #[allow(clippy::absurd_extreme_comparisons)]
30900 #[allow(unused_comparisons)]
30901 if __tmp.remaining() < Self::ENCODED_LEN {
30902 panic!(
30903 "buffer is too small (need {} bytes, but got {})",
30904 Self::ENCODED_LEN,
30905 __tmp.remaining(),
30906 )
30907 }
30908 __tmp.put_f32_le(self.framerate);
30909 __tmp.put_u32_le(self.bitrate);
30910 __tmp.put_u16_le(self.flags.bits());
30911 __tmp.put_u16_le(self.resolution_h);
30912 __tmp.put_u16_le(self.resolution_v);
30913 __tmp.put_u16_le(self.rotation);
30914 __tmp.put_u16_le(self.hfov);
30915 __tmp.put_u8(self.stream_id);
30916 __tmp.put_u8(self.count);
30917 __tmp.put_u8(self.mavtype as u8);
30918 for val in &self.name {
30919 __tmp.put_u8(*val);
30920 }
30921 for val in &self.uri {
30922 __tmp.put_u8(*val);
30923 }
30924 if matches!(version, MavlinkVersion::V2) {
30925 __tmp.put_u8(self.encoding as u8);
30926 __tmp.put_u8(self.camera_device_id);
30927 let len = __tmp.len();
30928 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
30929 } else {
30930 __tmp.len()
30931 }
30932 }
30933}
30934#[doc = "Information about the status of a video stream. It may be requested using MAV_CMD_REQUEST_MESSAGE."]
30935#[doc = ""]
30936#[doc = "ID: 270"]
30937#[derive(Debug, Clone, PartialEq)]
30938#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
30939#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
30940pub struct VIDEO_STREAM_STATUS_DATA {
30941 #[doc = "Frame rate"]
30942 pub framerate: f32,
30943 #[doc = "Bit rate"]
30944 pub bitrate: u32,
30945 #[doc = "Bitmap of stream status flags"]
30946 pub flags: VideoStreamStatusFlags,
30947 #[doc = "Horizontal resolution"]
30948 pub resolution_h: u16,
30949 #[doc = "Vertical resolution"]
30950 pub resolution_v: u16,
30951 #[doc = "Video image rotation clockwise"]
30952 pub rotation: u16,
30953 #[doc = "Horizontal Field of view"]
30954 pub hfov: u16,
30955 #[doc = "Video Stream ID (1 for first, 2 for second, etc.)"]
30956 pub stream_id: u8,
30957 #[doc = "Camera id of a non-MAVLink camera attached to an autopilot (1-6). 0 if the component is a MAVLink camera (with its own component id)."]
30958 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
30959 pub camera_device_id: u8,
30960}
30961impl VIDEO_STREAM_STATUS_DATA {
30962 pub const ENCODED_LEN: usize = 20usize;
30963 pub const DEFAULT: Self = Self {
30964 framerate: 0.0_f32,
30965 bitrate: 0_u32,
30966 flags: VideoStreamStatusFlags::DEFAULT,
30967 resolution_h: 0_u16,
30968 resolution_v: 0_u16,
30969 rotation: 0_u16,
30970 hfov: 0_u16,
30971 stream_id: 0_u8,
30972 camera_device_id: 0_u8,
30973 };
30974 #[cfg(feature = "arbitrary")]
30975 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
30976 use arbitrary::{Arbitrary, Unstructured};
30977 let mut buf = [0u8; 1024];
30978 rng.fill_bytes(&mut buf);
30979 let mut unstructured = Unstructured::new(&buf);
30980 Self::arbitrary(&mut unstructured).unwrap_or_default()
30981 }
30982}
30983impl Default for VIDEO_STREAM_STATUS_DATA {
30984 fn default() -> Self {
30985 Self::DEFAULT.clone()
30986 }
30987}
30988impl MessageData for VIDEO_STREAM_STATUS_DATA {
30989 type Message = MavMessage;
30990 const ID: u32 = 270u32;
30991 const NAME: &'static str = "VIDEO_STREAM_STATUS";
30992 const EXTRA_CRC: u8 = 59u8;
30993 const ENCODED_LEN: usize = 20usize;
30994 fn deser(
30995 _version: MavlinkVersion,
30996 __input: &[u8],
30997 ) -> Result<Self, ::mavlink_core::error::ParserError> {
30998 let avail_len = __input.len();
30999 let mut payload_buf = [0; Self::ENCODED_LEN];
31000 let mut buf = if avail_len < Self::ENCODED_LEN {
31001 payload_buf[0..avail_len].copy_from_slice(__input);
31002 Bytes::new(&payload_buf)
31003 } else {
31004 Bytes::new(__input)
31005 };
31006 let mut __struct = Self::default();
31007 __struct.framerate = buf.get_f32_le();
31008 __struct.bitrate = buf.get_u32_le();
31009 let tmp = buf.get_u16_le();
31010 __struct.flags = VideoStreamStatusFlags::from_bits(
31011 tmp & VideoStreamStatusFlags::all().bits(),
31012 )
31013 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
31014 flag_type: "VideoStreamStatusFlags",
31015 value: tmp as u32,
31016 })?;
31017 __struct.resolution_h = buf.get_u16_le();
31018 __struct.resolution_v = buf.get_u16_le();
31019 __struct.rotation = buf.get_u16_le();
31020 __struct.hfov = buf.get_u16_le();
31021 __struct.stream_id = buf.get_u8();
31022 __struct.camera_device_id = buf.get_u8();
31023 Ok(__struct)
31024 }
31025 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
31026 let mut __tmp = BytesMut::new(bytes);
31027 #[allow(clippy::absurd_extreme_comparisons)]
31028 #[allow(unused_comparisons)]
31029 if __tmp.remaining() < Self::ENCODED_LEN {
31030 panic!(
31031 "buffer is too small (need {} bytes, but got {})",
31032 Self::ENCODED_LEN,
31033 __tmp.remaining(),
31034 )
31035 }
31036 __tmp.put_f32_le(self.framerate);
31037 __tmp.put_u32_le(self.bitrate);
31038 __tmp.put_u16_le(self.flags.bits());
31039 __tmp.put_u16_le(self.resolution_h);
31040 __tmp.put_u16_le(self.resolution_v);
31041 __tmp.put_u16_le(self.rotation);
31042 __tmp.put_u16_le(self.hfov);
31043 __tmp.put_u8(self.stream_id);
31044 if matches!(version, MavlinkVersion::V2) {
31045 __tmp.put_u8(self.camera_device_id);
31046 let len = __tmp.len();
31047 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
31048 } else {
31049 __tmp.len()
31050 }
31051 }
31052}
31053#[doc = "Local position/attitude estimate from a vision source."]
31054#[doc = ""]
31055#[doc = "ID: 102"]
31056#[derive(Debug, Clone, PartialEq)]
31057#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
31058#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
31059pub struct VISION_POSITION_ESTIMATE_DATA {
31060 #[doc = "Timestamp (UNIX time or time since system boot)"]
31061 pub usec: u64,
31062 #[doc = "Local X position"]
31063 pub x: f32,
31064 #[doc = "Local Y position"]
31065 pub y: f32,
31066 #[doc = "Local Z position"]
31067 pub z: f32,
31068 #[doc = "Roll angle"]
31069 pub roll: f32,
31070 #[doc = "Pitch angle"]
31071 pub pitch: f32,
31072 #[doc = "Yaw angle"]
31073 pub yaw: f32,
31074 #[doc = "Row-major representation of pose 6x6 cross-covariance matrix upper right triangle (states: x, y, z, roll, pitch, yaw; first six entries are the first ROW, next five entries are the second ROW, etc.). If unknown, assign NaN value to first element in the array."]
31075 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
31076 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
31077 pub covariance: [f32; 21],
31078 #[doc = "Estimate reset counter. This should be incremented when the estimate resets in any of the dimensions (position, velocity, attitude, angular speed). This is designed to be used when e.g an external SLAM system detects a loop-closure and the estimate jumps."]
31079 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
31080 pub reset_counter: u8,
31081}
31082impl VISION_POSITION_ESTIMATE_DATA {
31083 pub const ENCODED_LEN: usize = 117usize;
31084 pub const DEFAULT: Self = Self {
31085 usec: 0_u64,
31086 x: 0.0_f32,
31087 y: 0.0_f32,
31088 z: 0.0_f32,
31089 roll: 0.0_f32,
31090 pitch: 0.0_f32,
31091 yaw: 0.0_f32,
31092 covariance: [0.0_f32; 21usize],
31093 reset_counter: 0_u8,
31094 };
31095 #[cfg(feature = "arbitrary")]
31096 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
31097 use arbitrary::{Arbitrary, Unstructured};
31098 let mut buf = [0u8; 1024];
31099 rng.fill_bytes(&mut buf);
31100 let mut unstructured = Unstructured::new(&buf);
31101 Self::arbitrary(&mut unstructured).unwrap_or_default()
31102 }
31103}
31104impl Default for VISION_POSITION_ESTIMATE_DATA {
31105 fn default() -> Self {
31106 Self::DEFAULT.clone()
31107 }
31108}
31109impl MessageData for VISION_POSITION_ESTIMATE_DATA {
31110 type Message = MavMessage;
31111 const ID: u32 = 102u32;
31112 const NAME: &'static str = "VISION_POSITION_ESTIMATE";
31113 const EXTRA_CRC: u8 = 158u8;
31114 const ENCODED_LEN: usize = 117usize;
31115 fn deser(
31116 _version: MavlinkVersion,
31117 __input: &[u8],
31118 ) -> Result<Self, ::mavlink_core::error::ParserError> {
31119 let avail_len = __input.len();
31120 let mut payload_buf = [0; Self::ENCODED_LEN];
31121 let mut buf = if avail_len < Self::ENCODED_LEN {
31122 payload_buf[0..avail_len].copy_from_slice(__input);
31123 Bytes::new(&payload_buf)
31124 } else {
31125 Bytes::new(__input)
31126 };
31127 let mut __struct = Self::default();
31128 __struct.usec = buf.get_u64_le();
31129 __struct.x = buf.get_f32_le();
31130 __struct.y = buf.get_f32_le();
31131 __struct.z = buf.get_f32_le();
31132 __struct.roll = buf.get_f32_le();
31133 __struct.pitch = buf.get_f32_le();
31134 __struct.yaw = buf.get_f32_le();
31135 for v in &mut __struct.covariance {
31136 let val = buf.get_f32_le();
31137 *v = val;
31138 }
31139 __struct.reset_counter = buf.get_u8();
31140 Ok(__struct)
31141 }
31142 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
31143 let mut __tmp = BytesMut::new(bytes);
31144 #[allow(clippy::absurd_extreme_comparisons)]
31145 #[allow(unused_comparisons)]
31146 if __tmp.remaining() < Self::ENCODED_LEN {
31147 panic!(
31148 "buffer is too small (need {} bytes, but got {})",
31149 Self::ENCODED_LEN,
31150 __tmp.remaining(),
31151 )
31152 }
31153 __tmp.put_u64_le(self.usec);
31154 __tmp.put_f32_le(self.x);
31155 __tmp.put_f32_le(self.y);
31156 __tmp.put_f32_le(self.z);
31157 __tmp.put_f32_le(self.roll);
31158 __tmp.put_f32_le(self.pitch);
31159 __tmp.put_f32_le(self.yaw);
31160 if matches!(version, MavlinkVersion::V2) {
31161 for val in &self.covariance {
31162 __tmp.put_f32_le(*val);
31163 }
31164 __tmp.put_u8(self.reset_counter);
31165 let len = __tmp.len();
31166 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
31167 } else {
31168 __tmp.len()
31169 }
31170 }
31171}
31172#[doc = "Speed estimate from a vision source."]
31173#[doc = ""]
31174#[doc = "ID: 103"]
31175#[derive(Debug, Clone, PartialEq)]
31176#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
31177#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
31178pub struct VISION_SPEED_ESTIMATE_DATA {
31179 #[doc = "Timestamp (UNIX time or time since system boot)"]
31180 pub usec: u64,
31181 #[doc = "Global X speed"]
31182 pub x: f32,
31183 #[doc = "Global Y speed"]
31184 pub y: f32,
31185 #[doc = "Global Z speed"]
31186 pub z: f32,
31187 #[doc = "Row-major representation of 3x3 linear velocity covariance matrix (states: vx, vy, vz; 1st three entries - 1st row, etc.). If unknown, assign NaN value to first element in the array."]
31188 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
31189 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
31190 pub covariance: [f32; 9],
31191 #[doc = "Estimate reset counter. This should be incremented when the estimate resets in any of the dimensions (position, velocity, attitude, angular speed). This is designed to be used when e.g an external SLAM system detects a loop-closure and the estimate jumps."]
31192 #[cfg_attr(feature = "serde", serde(default = "crate::RustDefault::rust_default"))]
31193 pub reset_counter: u8,
31194}
31195impl VISION_SPEED_ESTIMATE_DATA {
31196 pub const ENCODED_LEN: usize = 57usize;
31197 pub const DEFAULT: Self = Self {
31198 usec: 0_u64,
31199 x: 0.0_f32,
31200 y: 0.0_f32,
31201 z: 0.0_f32,
31202 covariance: [0.0_f32; 9usize],
31203 reset_counter: 0_u8,
31204 };
31205 #[cfg(feature = "arbitrary")]
31206 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
31207 use arbitrary::{Arbitrary, Unstructured};
31208 let mut buf = [0u8; 1024];
31209 rng.fill_bytes(&mut buf);
31210 let mut unstructured = Unstructured::new(&buf);
31211 Self::arbitrary(&mut unstructured).unwrap_or_default()
31212 }
31213}
31214impl Default for VISION_SPEED_ESTIMATE_DATA {
31215 fn default() -> Self {
31216 Self::DEFAULT.clone()
31217 }
31218}
31219impl MessageData for VISION_SPEED_ESTIMATE_DATA {
31220 type Message = MavMessage;
31221 const ID: u32 = 103u32;
31222 const NAME: &'static str = "VISION_SPEED_ESTIMATE";
31223 const EXTRA_CRC: u8 = 208u8;
31224 const ENCODED_LEN: usize = 57usize;
31225 fn deser(
31226 _version: MavlinkVersion,
31227 __input: &[u8],
31228 ) -> Result<Self, ::mavlink_core::error::ParserError> {
31229 let avail_len = __input.len();
31230 let mut payload_buf = [0; Self::ENCODED_LEN];
31231 let mut buf = if avail_len < Self::ENCODED_LEN {
31232 payload_buf[0..avail_len].copy_from_slice(__input);
31233 Bytes::new(&payload_buf)
31234 } else {
31235 Bytes::new(__input)
31236 };
31237 let mut __struct = Self::default();
31238 __struct.usec = buf.get_u64_le();
31239 __struct.x = buf.get_f32_le();
31240 __struct.y = buf.get_f32_le();
31241 __struct.z = buf.get_f32_le();
31242 for v in &mut __struct.covariance {
31243 let val = buf.get_f32_le();
31244 *v = val;
31245 }
31246 __struct.reset_counter = buf.get_u8();
31247 Ok(__struct)
31248 }
31249 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
31250 let mut __tmp = BytesMut::new(bytes);
31251 #[allow(clippy::absurd_extreme_comparisons)]
31252 #[allow(unused_comparisons)]
31253 if __tmp.remaining() < Self::ENCODED_LEN {
31254 panic!(
31255 "buffer is too small (need {} bytes, but got {})",
31256 Self::ENCODED_LEN,
31257 __tmp.remaining(),
31258 )
31259 }
31260 __tmp.put_u64_le(self.usec);
31261 __tmp.put_f32_le(self.x);
31262 __tmp.put_f32_le(self.y);
31263 __tmp.put_f32_le(self.z);
31264 if matches!(version, MavlinkVersion::V2) {
31265 for val in &self.covariance {
31266 __tmp.put_f32_le(*val);
31267 }
31268 __tmp.put_u8(self.reset_counter);
31269 let len = __tmp.len();
31270 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
31271 } else {
31272 __tmp.len()
31273 }
31274 }
31275}
31276#[doc = "Cumulative distance traveled for each reported wheel."]
31277#[doc = ""]
31278#[doc = "ID: 9000"]
31279#[derive(Debug, Clone, PartialEq)]
31280#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
31281#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
31282pub struct WHEEL_DISTANCE_DATA {
31283 #[doc = "Timestamp (synced to UNIX time or since system boot)."]
31284 pub time_usec: u64,
31285 #[doc = "Distance reported by individual wheel encoders. Forward rotations increase values, reverse rotations decrease them. Not all wheels will necessarily have wheel encoders; the mapping of encoders to wheel positions must be agreed/understood by the endpoints."]
31286 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
31287 pub distance: [f64; 16],
31288 #[doc = "Number of wheels reported."]
31289 pub count: u8,
31290}
31291impl WHEEL_DISTANCE_DATA {
31292 pub const ENCODED_LEN: usize = 137usize;
31293 pub const DEFAULT: Self = Self {
31294 time_usec: 0_u64,
31295 distance: [0.0_f64; 16usize],
31296 count: 0_u8,
31297 };
31298 #[cfg(feature = "arbitrary")]
31299 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
31300 use arbitrary::{Arbitrary, Unstructured};
31301 let mut buf = [0u8; 1024];
31302 rng.fill_bytes(&mut buf);
31303 let mut unstructured = Unstructured::new(&buf);
31304 Self::arbitrary(&mut unstructured).unwrap_or_default()
31305 }
31306}
31307impl Default for WHEEL_DISTANCE_DATA {
31308 fn default() -> Self {
31309 Self::DEFAULT.clone()
31310 }
31311}
31312impl MessageData for WHEEL_DISTANCE_DATA {
31313 type Message = MavMessage;
31314 const ID: u32 = 9000u32;
31315 const NAME: &'static str = "WHEEL_DISTANCE";
31316 const EXTRA_CRC: u8 = 113u8;
31317 const ENCODED_LEN: usize = 137usize;
31318 fn deser(
31319 _version: MavlinkVersion,
31320 __input: &[u8],
31321 ) -> Result<Self, ::mavlink_core::error::ParserError> {
31322 let avail_len = __input.len();
31323 let mut payload_buf = [0; Self::ENCODED_LEN];
31324 let mut buf = if avail_len < Self::ENCODED_LEN {
31325 payload_buf[0..avail_len].copy_from_slice(__input);
31326 Bytes::new(&payload_buf)
31327 } else {
31328 Bytes::new(__input)
31329 };
31330 let mut __struct = Self::default();
31331 __struct.time_usec = buf.get_u64_le();
31332 for v in &mut __struct.distance {
31333 let val = buf.get_f64_le();
31334 *v = val;
31335 }
31336 __struct.count = buf.get_u8();
31337 Ok(__struct)
31338 }
31339 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
31340 let mut __tmp = BytesMut::new(bytes);
31341 #[allow(clippy::absurd_extreme_comparisons)]
31342 #[allow(unused_comparisons)]
31343 if __tmp.remaining() < Self::ENCODED_LEN {
31344 panic!(
31345 "buffer is too small (need {} bytes, but got {})",
31346 Self::ENCODED_LEN,
31347 __tmp.remaining(),
31348 )
31349 }
31350 __tmp.put_u64_le(self.time_usec);
31351 for val in &self.distance {
31352 __tmp.put_f64_le(*val);
31353 }
31354 __tmp.put_u8(self.count);
31355 if matches!(version, MavlinkVersion::V2) {
31356 let len = __tmp.len();
31357 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
31358 } else {
31359 __tmp.len()
31360 }
31361 }
31362}
31363#[doc = "Configure WiFi AP SSID, password, and mode. This message is re-emitted as an acknowledgement by the AP. The message may also be explicitly requested using MAV_CMD_REQUEST_MESSAGE."]
31364#[doc = ""]
31365#[doc = "ID: 299"]
31366#[derive(Debug, Clone, PartialEq)]
31367#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
31368#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
31369pub struct WIFI_CONFIG_AP_DATA {
31370 #[doc = "Name of Wi-Fi network (SSID). Blank to leave it unchanged when setting. Current SSID when sent back as a response."]
31371 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
31372 pub ssid: [u8; 32],
31373 #[doc = "Password. Blank for an open AP. MD5 hash when message is sent back as a response."]
31374 #[cfg_attr(feature = "serde", serde(with = "serde_arrays"))]
31375 pub password: [u8; 64],
31376 #[doc = "WiFi Mode."]
31377 #[cfg_attr(feature = "serde", serde(default))]
31378 pub mode: WifiConfigApMode,
31379 #[doc = "Message acceptance response (sent back to GS)."]
31380 #[cfg_attr(feature = "serde", serde(default))]
31381 pub response: WifiConfigApResponse,
31382}
31383impl WIFI_CONFIG_AP_DATA {
31384 pub const ENCODED_LEN: usize = 98usize;
31385 pub const DEFAULT: Self = Self {
31386 ssid: [0_u8; 32usize],
31387 password: [0_u8; 64usize],
31388 mode: WifiConfigApMode::DEFAULT,
31389 response: WifiConfigApResponse::DEFAULT,
31390 };
31391 #[cfg(feature = "arbitrary")]
31392 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
31393 use arbitrary::{Arbitrary, Unstructured};
31394 let mut buf = [0u8; 1024];
31395 rng.fill_bytes(&mut buf);
31396 let mut unstructured = Unstructured::new(&buf);
31397 Self::arbitrary(&mut unstructured).unwrap_or_default()
31398 }
31399}
31400impl Default for WIFI_CONFIG_AP_DATA {
31401 fn default() -> Self {
31402 Self::DEFAULT.clone()
31403 }
31404}
31405impl MessageData for WIFI_CONFIG_AP_DATA {
31406 type Message = MavMessage;
31407 const ID: u32 = 299u32;
31408 const NAME: &'static str = "WIFI_CONFIG_AP";
31409 const EXTRA_CRC: u8 = 19u8;
31410 const ENCODED_LEN: usize = 98usize;
31411 fn deser(
31412 _version: MavlinkVersion,
31413 __input: &[u8],
31414 ) -> Result<Self, ::mavlink_core::error::ParserError> {
31415 let avail_len = __input.len();
31416 let mut payload_buf = [0; Self::ENCODED_LEN];
31417 let mut buf = if avail_len < Self::ENCODED_LEN {
31418 payload_buf[0..avail_len].copy_from_slice(__input);
31419 Bytes::new(&payload_buf)
31420 } else {
31421 Bytes::new(__input)
31422 };
31423 let mut __struct = Self::default();
31424 for v in &mut __struct.ssid {
31425 let val = buf.get_u8();
31426 *v = val;
31427 }
31428 for v in &mut __struct.password {
31429 let val = buf.get_u8();
31430 *v = val;
31431 }
31432 let tmp = buf.get_i8();
31433 __struct.mode =
31434 FromPrimitive::from_i8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
31435 enum_type: "WifiConfigApMode",
31436 value: tmp as u32,
31437 })?;
31438 let tmp = buf.get_i8();
31439 __struct.response =
31440 FromPrimitive::from_i8(tmp).ok_or(::mavlink_core::error::ParserError::InvalidEnum {
31441 enum_type: "WifiConfigApResponse",
31442 value: tmp as u32,
31443 })?;
31444 Ok(__struct)
31445 }
31446 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
31447 let mut __tmp = BytesMut::new(bytes);
31448 #[allow(clippy::absurd_extreme_comparisons)]
31449 #[allow(unused_comparisons)]
31450 if __tmp.remaining() < Self::ENCODED_LEN {
31451 panic!(
31452 "buffer is too small (need {} bytes, but got {})",
31453 Self::ENCODED_LEN,
31454 __tmp.remaining(),
31455 )
31456 }
31457 for val in &self.ssid {
31458 __tmp.put_u8(*val);
31459 }
31460 for val in &self.password {
31461 __tmp.put_u8(*val);
31462 }
31463 if matches!(version, MavlinkVersion::V2) {
31464 __tmp.put_i8(self.mode as i8);
31465 __tmp.put_i8(self.response as i8);
31466 let len = __tmp.len();
31467 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
31468 } else {
31469 __tmp.len()
31470 }
31471 }
31472}
31473#[doc = "Winch status."]
31474#[doc = ""]
31475#[doc = "ID: 9005"]
31476#[derive(Debug, Clone, PartialEq)]
31477#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
31478#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
31479pub struct WINCH_STATUS_DATA {
31480 #[doc = "Timestamp (synced to UNIX time or since system boot)."]
31481 pub time_usec: u64,
31482 #[doc = "Length of line released. NaN if unknown"]
31483 pub line_length: f32,
31484 #[doc = "Speed line is being released or retracted. Positive values if being released, negative values if being retracted, NaN if unknown"]
31485 pub speed: f32,
31486 #[doc = "Tension on the line. NaN if unknown"]
31487 pub tension: f32,
31488 #[doc = "Voltage of the battery supplying the winch. NaN if unknown"]
31489 pub voltage: f32,
31490 #[doc = "Current draw from the winch. NaN if unknown"]
31491 pub current: f32,
31492 #[doc = "Status flags"]
31493 pub status: MavWinchStatusFlag,
31494 #[doc = "Temperature of the motor. INT16_MAX if unknown"]
31495 pub temperature: i16,
31496}
31497impl WINCH_STATUS_DATA {
31498 pub const ENCODED_LEN: usize = 34usize;
31499 pub const DEFAULT: Self = Self {
31500 time_usec: 0_u64,
31501 line_length: 0.0_f32,
31502 speed: 0.0_f32,
31503 tension: 0.0_f32,
31504 voltage: 0.0_f32,
31505 current: 0.0_f32,
31506 status: MavWinchStatusFlag::DEFAULT,
31507 temperature: 0_i16,
31508 };
31509 #[cfg(feature = "arbitrary")]
31510 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
31511 use arbitrary::{Arbitrary, Unstructured};
31512 let mut buf = [0u8; 1024];
31513 rng.fill_bytes(&mut buf);
31514 let mut unstructured = Unstructured::new(&buf);
31515 Self::arbitrary(&mut unstructured).unwrap_or_default()
31516 }
31517}
31518impl Default for WINCH_STATUS_DATA {
31519 fn default() -> Self {
31520 Self::DEFAULT.clone()
31521 }
31522}
31523impl MessageData for WINCH_STATUS_DATA {
31524 type Message = MavMessage;
31525 const ID: u32 = 9005u32;
31526 const NAME: &'static str = "WINCH_STATUS";
31527 const EXTRA_CRC: u8 = 117u8;
31528 const ENCODED_LEN: usize = 34usize;
31529 fn deser(
31530 _version: MavlinkVersion,
31531 __input: &[u8],
31532 ) -> Result<Self, ::mavlink_core::error::ParserError> {
31533 let avail_len = __input.len();
31534 let mut payload_buf = [0; Self::ENCODED_LEN];
31535 let mut buf = if avail_len < Self::ENCODED_LEN {
31536 payload_buf[0..avail_len].copy_from_slice(__input);
31537 Bytes::new(&payload_buf)
31538 } else {
31539 Bytes::new(__input)
31540 };
31541 let mut __struct = Self::default();
31542 __struct.time_usec = buf.get_u64_le();
31543 __struct.line_length = buf.get_f32_le();
31544 __struct.speed = buf.get_f32_le();
31545 __struct.tension = buf.get_f32_le();
31546 __struct.voltage = buf.get_f32_le();
31547 __struct.current = buf.get_f32_le();
31548 let tmp = buf.get_u32_le();
31549 __struct.status = MavWinchStatusFlag::from_bits(tmp & MavWinchStatusFlag::all().bits())
31550 .ok_or(::mavlink_core::error::ParserError::InvalidFlag {
31551 flag_type: "MavWinchStatusFlag",
31552 value: tmp as u32,
31553 })?;
31554 __struct.temperature = buf.get_i16_le();
31555 Ok(__struct)
31556 }
31557 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
31558 let mut __tmp = BytesMut::new(bytes);
31559 #[allow(clippy::absurd_extreme_comparisons)]
31560 #[allow(unused_comparisons)]
31561 if __tmp.remaining() < Self::ENCODED_LEN {
31562 panic!(
31563 "buffer is too small (need {} bytes, but got {})",
31564 Self::ENCODED_LEN,
31565 __tmp.remaining(),
31566 )
31567 }
31568 __tmp.put_u64_le(self.time_usec);
31569 __tmp.put_f32_le(self.line_length);
31570 __tmp.put_f32_le(self.speed);
31571 __tmp.put_f32_le(self.tension);
31572 __tmp.put_f32_le(self.voltage);
31573 __tmp.put_f32_le(self.current);
31574 __tmp.put_u32_le(self.status.bits());
31575 __tmp.put_i16_le(self.temperature);
31576 if matches!(version, MavlinkVersion::V2) {
31577 let len = __tmp.len();
31578 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
31579 } else {
31580 __tmp.len()
31581 }
31582 }
31583}
31584#[doc = "Wind estimate from vehicle. Note that despite the name, this message does not actually contain any covariances but instead variability and accuracy fields in terms of standard deviation (1-STD)."]
31585#[doc = ""]
31586#[doc = "ID: 231"]
31587#[derive(Debug, Clone, PartialEq)]
31588#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
31589#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
31590pub struct WIND_COV_DATA {
31591 #[doc = "Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number."]
31592 pub time_usec: u64,
31593 #[doc = "Wind in North (NED) direction (NAN if unknown)"]
31594 pub wind_x: f32,
31595 #[doc = "Wind in East (NED) direction (NAN if unknown)"]
31596 pub wind_y: f32,
31597 #[doc = "Wind in down (NED) direction (NAN if unknown)"]
31598 pub wind_z: f32,
31599 #[doc = "Variability of wind in XY, 1-STD estimated from a 1 Hz lowpassed wind estimate (NAN if unknown)"]
31600 pub var_horiz: f32,
31601 #[doc = "Variability of wind in Z, 1-STD estimated from a 1 Hz lowpassed wind estimate (NAN if unknown)"]
31602 pub var_vert: f32,
31603 #[doc = "Altitude (MSL) that this measurement was taken at (NAN if unknown)"]
31604 pub wind_alt: f32,
31605 #[doc = "Horizontal speed 1-STD accuracy (0 if unknown)"]
31606 pub horiz_accuracy: f32,
31607 #[doc = "Vertical speed 1-STD accuracy (0 if unknown)"]
31608 pub vert_accuracy: f32,
31609}
31610impl WIND_COV_DATA {
31611 pub const ENCODED_LEN: usize = 40usize;
31612 pub const DEFAULT: Self = Self {
31613 time_usec: 0_u64,
31614 wind_x: 0.0_f32,
31615 wind_y: 0.0_f32,
31616 wind_z: 0.0_f32,
31617 var_horiz: 0.0_f32,
31618 var_vert: 0.0_f32,
31619 wind_alt: 0.0_f32,
31620 horiz_accuracy: 0.0_f32,
31621 vert_accuracy: 0.0_f32,
31622 };
31623 #[cfg(feature = "arbitrary")]
31624 pub fn random<R: rand::RngCore>(rng: &mut R) -> Self {
31625 use arbitrary::{Arbitrary, Unstructured};
31626 let mut buf = [0u8; 1024];
31627 rng.fill_bytes(&mut buf);
31628 let mut unstructured = Unstructured::new(&buf);
31629 Self::arbitrary(&mut unstructured).unwrap_or_default()
31630 }
31631}
31632impl Default for WIND_COV_DATA {
31633 fn default() -> Self {
31634 Self::DEFAULT.clone()
31635 }
31636}
31637impl MessageData for WIND_COV_DATA {
31638 type Message = MavMessage;
31639 const ID: u32 = 231u32;
31640 const NAME: &'static str = "WIND_COV";
31641 const EXTRA_CRC: u8 = 105u8;
31642 const ENCODED_LEN: usize = 40usize;
31643 fn deser(
31644 _version: MavlinkVersion,
31645 __input: &[u8],
31646 ) -> Result<Self, ::mavlink_core::error::ParserError> {
31647 let avail_len = __input.len();
31648 let mut payload_buf = [0; Self::ENCODED_LEN];
31649 let mut buf = if avail_len < Self::ENCODED_LEN {
31650 payload_buf[0..avail_len].copy_from_slice(__input);
31651 Bytes::new(&payload_buf)
31652 } else {
31653 Bytes::new(__input)
31654 };
31655 let mut __struct = Self::default();
31656 __struct.time_usec = buf.get_u64_le();
31657 __struct.wind_x = buf.get_f32_le();
31658 __struct.wind_y = buf.get_f32_le();
31659 __struct.wind_z = buf.get_f32_le();
31660 __struct.var_horiz = buf.get_f32_le();
31661 __struct.var_vert = buf.get_f32_le();
31662 __struct.wind_alt = buf.get_f32_le();
31663 __struct.horiz_accuracy = buf.get_f32_le();
31664 __struct.vert_accuracy = buf.get_f32_le();
31665 Ok(__struct)
31666 }
31667 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
31668 let mut __tmp = BytesMut::new(bytes);
31669 #[allow(clippy::absurd_extreme_comparisons)]
31670 #[allow(unused_comparisons)]
31671 if __tmp.remaining() < Self::ENCODED_LEN {
31672 panic!(
31673 "buffer is too small (need {} bytes, but got {})",
31674 Self::ENCODED_LEN,
31675 __tmp.remaining(),
31676 )
31677 }
31678 __tmp.put_u64_le(self.time_usec);
31679 __tmp.put_f32_le(self.wind_x);
31680 __tmp.put_f32_le(self.wind_y);
31681 __tmp.put_f32_le(self.wind_z);
31682 __tmp.put_f32_le(self.var_horiz);
31683 __tmp.put_f32_le(self.var_vert);
31684 __tmp.put_f32_le(self.wind_alt);
31685 __tmp.put_f32_le(self.horiz_accuracy);
31686 __tmp.put_f32_le(self.vert_accuracy);
31687 if matches!(version, MavlinkVersion::V2) {
31688 let len = __tmp.len();
31689 ::mavlink_core::utils::remove_trailing_zeroes(&bytes[..len])
31690 } else {
31691 __tmp.len()
31692 }
31693 }
31694}
31695#[derive(Clone, PartialEq, Debug)]
31696#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
31697#[cfg_attr(feature = "serde", serde(tag = "type"))]
31698#[cfg_attr(feature = "arbitrary", derive(Arbitrary))]
31699#[repr(u32)]
31700pub enum MavMessage {
31701 #[doc = "Set the vehicle attitude and body angular rates."]
31702 #[doc = ""]
31703 #[doc = "ID: 140"]
31704 ACTUATOR_CONTROL_TARGET(ACTUATOR_CONTROL_TARGET_DATA),
31705 #[doc = "The raw values of the actuator outputs (e.g. on Pixhawk, from MAIN, AUX ports). This message supersedes SERVO_OUTPUT_RAW."]
31706 #[doc = ""]
31707 #[doc = "ID: 375"]
31708 ACTUATOR_OUTPUT_STATUS(ACTUATOR_OUTPUT_STATUS_DATA),
31709 #[doc = "The location and information of an ADSB vehicle."]
31710 #[doc = ""]
31711 #[doc = "ID: 246"]
31712 ADSB_VEHICLE(ADSB_VEHICLE_DATA),
31713 #[doc = "The location and information of an AIS vessel."]
31714 #[doc = ""]
31715 #[doc = "ID: 301"]
31716 AIS_VESSEL(AIS_VESSEL_DATA),
31717 #[doc = "The current system altitude."]
31718 #[doc = ""]
31719 #[doc = "ID: 141"]
31720 ALTITUDE(ALTITUDE_DATA),
31721 #[doc = "The attitude in the aeronautical frame (right-handed, Z-down, Y-right, X-front, ZYX, intrinsic)."]
31722 #[doc = ""]
31723 #[doc = "ID: 30"]
31724 ATTITUDE(ATTITUDE_DATA),
31725 #[doc = "The attitude in the aeronautical frame (right-handed, Z-down, X-front, Y-right), expressed as quaternion. Quaternion order is w, x, y, z and a zero rotation would be expressed as (1 0 0 0)."]
31726 #[doc = ""]
31727 #[doc = "ID: 31"]
31728 ATTITUDE_QUATERNION(ATTITUDE_QUATERNION_DATA),
31729 #[doc = "The attitude in the aeronautical frame (right-handed, Z-down, X-front, Y-right), expressed as quaternion. Quaternion order is w, x, y, z and a zero rotation would be expressed as (1 0 0 0)."]
31730 #[doc = ""]
31731 #[doc = "ID: 61"]
31732 ATTITUDE_QUATERNION_COV(ATTITUDE_QUATERNION_COV_DATA),
31733 #[doc = "Reports the current commanded attitude of the vehicle as specified by the autopilot. This should match the commands sent in a SET_ATTITUDE_TARGET message if the vehicle is being controlled this way."]
31734 #[doc = ""]
31735 #[doc = "ID: 83"]
31736 ATTITUDE_TARGET(ATTITUDE_TARGET_DATA),
31737 #[doc = "Motion capture attitude and position."]
31738 #[doc = ""]
31739 #[doc = "ID: 138"]
31740 ATT_POS_MOCAP(ATT_POS_MOCAP_DATA),
31741 #[doc = "Emit an encrypted signature / key identifying this system. PLEASE NOTE: This protocol has been kept simple, so transmitting the key requires an encrypted channel for true safety."]
31742 #[doc = ""]
31743 #[doc = "ID: 7"]
31744 AUTH_KEY(AUTH_KEY_DATA),
31745 #[doc = "Low level message containing autopilot state relevant for a gimbal device. This message is to be sent from the autopilot to the gimbal device component. The data of this message are for the gimbal device's estimator corrections, in particular horizon compensation, as well as indicates autopilot control intentions, e.g. feed forward angular control in the z-axis."]
31746 #[doc = ""]
31747 #[doc = "ID: 286"]
31748 AUTOPILOT_STATE_FOR_GIMBAL_DEVICE(AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA),
31749 #[doc = "Version and capability of autopilot software. This should be emitted in response to a request with MAV_CMD_REQUEST_MESSAGE."]
31750 #[doc = ""]
31751 #[doc = "ID: 148"]
31752 AUTOPILOT_VERSION(AUTOPILOT_VERSION_DATA),
31753 #[doc = "Information about a flight mode. The message can be enumerated to get information for all modes, or requested for a particular mode, using MAV_CMD_REQUEST_MESSAGE. Specify 0 in param2 to request that the message is emitted for all available modes or the specific index for just one mode. The modes must be available/settable for the current vehicle/frame type. Each mode should only be emitted once (even if it is both standard and custom). Note that the current mode should be emitted in CURRENT_MODE, and that if the mode list can change then AVAILABLE_MODES_MONITOR must be emitted on first change and subsequently streamed. See <https://mavlink.io/en/services/standard_modes.html>."]
31754 #[doc = ""]
31755 #[doc = "ID: 435"]
31756 AVAILABLE_MODES(AVAILABLE_MODES_DATA),
31757 #[doc = "A change to the sequence number indicates that the set of AVAILABLE_MODES has changed. A receiver must re-request all available modes whenever the sequence number changes. This is only emitted after the first change and should then be broadcast at low rate (nominally 0.3 Hz) and on change. See <https://mavlink.io/en/services/standard_modes.html>."]
31758 #[doc = ""]
31759 #[doc = "ID: 437"]
31760 AVAILABLE_MODES_MONITOR(AVAILABLE_MODES_MONITOR_DATA),
31761 #[doc = "Drone IMU data. Quaternion order is w, x, y, z and a zero rotation would be expressed as (1 0 0 0)."]
31762 #[doc = ""]
31763 #[doc = "ID: 60052"]
31764 AVSS_DRONE_IMU(AVSS_DRONE_IMU_DATA),
31765 #[doc = "Drone operation mode."]
31766 #[doc = ""]
31767 #[doc = "ID: 60053"]
31768 AVSS_DRONE_OPERATION_MODE(AVSS_DRONE_OPERATION_MODE_DATA),
31769 #[doc = "Drone position."]
31770 #[doc = ""]
31771 #[doc = "ID: 60051"]
31772 AVSS_DRONE_POSITION(AVSS_DRONE_POSITION_DATA),
31773 #[doc = "AVSS PRS system status."]
31774 #[doc = ""]
31775 #[doc = "ID: 60050"]
31776 AVSS_PRS_SYS_STATUS(AVSS_PRS_SYS_STATUS_DATA),
31777 #[doc = "Battery information that is static, or requires infrequent update. This message should requested using MAV_CMD_REQUEST_MESSAGE and/or streamed at very low rate. BATTERY_STATUS_V2 is used for higher-rate battery status information."]
31778 #[doc = ""]
31779 #[doc = "ID: 372"]
31780 BATTERY_INFO(BATTERY_INFO_DATA),
31781 #[doc = "Battery information. Updates GCS with flight controller battery status. Smart batteries also use this message, but may additionally send BATTERY_INFO."]
31782 #[doc = ""]
31783 #[doc = "ID: 147"]
31784 BATTERY_STATUS(BATTERY_STATUS_DATA),
31785 #[doc = "Report button state change."]
31786 #[doc = ""]
31787 #[doc = "ID: 257"]
31788 BUTTON_CHANGE(BUTTON_CHANGE_DATA),
31789 #[doc = "Information about the status of a capture. Can be requested with a MAV_CMD_REQUEST_MESSAGE command."]
31790 #[doc = ""]
31791 #[doc = "ID: 262"]
31792 CAMERA_CAPTURE_STATUS(CAMERA_CAPTURE_STATUS_DATA),
31793 #[doc = "Information about the field of view of a camera. Can be requested with a MAV_CMD_REQUEST_MESSAGE command."]
31794 #[doc = ""]
31795 #[doc = "ID: 271"]
31796 CAMERA_FOV_STATUS(CAMERA_FOV_STATUS_DATA),
31797 #[doc = "Information about a captured image. This is emitted every time a message is captured. MAV_CMD_REQUEST_MESSAGE can be used to (re)request this message for a specific sequence number or range of sequence numbers: MAV_CMD_REQUEST_MESSAGE.param2 indicates the sequence number the first image to send, or set to -1 to send the message for all sequence numbers. MAV_CMD_REQUEST_MESSAGE.param3 is used to specify a range of messages to send: set to 0 (default) to send just the the message for the sequence number in param 2, set to -1 to send the message for the sequence number in param 2 and all the following sequence numbers, set to the sequence number of the final message in the range."]
31798 #[doc = ""]
31799 #[doc = "ID: 263"]
31800 CAMERA_IMAGE_CAPTURED(CAMERA_IMAGE_CAPTURED_DATA),
31801 #[doc = "Information about a camera. Can be requested with a MAV_CMD_REQUEST_MESSAGE command."]
31802 #[doc = ""]
31803 #[doc = "ID: 259"]
31804 CAMERA_INFORMATION(CAMERA_INFORMATION_DATA),
31805 #[doc = "Settings of a camera. Can be requested with a MAV_CMD_REQUEST_MESSAGE command."]
31806 #[doc = ""]
31807 #[doc = "ID: 260"]
31808 CAMERA_SETTINGS(CAMERA_SETTINGS_DATA),
31809 #[doc = "Camera absolute thermal range. This can be streamed when the associated VIDEO_STREAM_STATUS `flag` field bit VIDEO_STREAM_STATUS_FLAGS_THERMAL_RANGE_ENABLED is set, but a GCS may choose to only request it for the current active stream. Use MAV_CMD_SET_MESSAGE_INTERVAL to define message interval (param3 indicates the stream id of the current camera, or 0 for all streams, param4 indicates the target camera_device_id for autopilot-attached cameras or 0 for MAVLink cameras)."]
31810 #[doc = ""]
31811 #[doc = "ID: 277"]
31812 CAMERA_THERMAL_RANGE(CAMERA_THERMAL_RANGE_DATA),
31813 #[doc = "Camera tracking status, sent while in active tracking. Use MAV_CMD_SET_MESSAGE_INTERVAL to define message interval."]
31814 #[doc = ""]
31815 #[doc = "ID: 276"]
31816 CAMERA_TRACKING_GEO_STATUS(CAMERA_TRACKING_GEO_STATUS_DATA),
31817 #[doc = "Camera tracking status, sent while in active tracking. Use MAV_CMD_SET_MESSAGE_INTERVAL to define message interval."]
31818 #[doc = ""]
31819 #[doc = "ID: 275"]
31820 CAMERA_TRACKING_IMAGE_STATUS(CAMERA_TRACKING_IMAGE_STATUS_DATA),
31821 #[doc = "Camera-IMU triggering and synchronisation message."]
31822 #[doc = ""]
31823 #[doc = "ID: 112"]
31824 CAMERA_TRIGGER(CAMERA_TRIGGER_DATA),
31825 #[doc = "A forwarded CANFD frame as requested by MAV_CMD_CAN_FORWARD. These are separated from CAN_FRAME as they need different handling (eg. TAO handling)."]
31826 #[doc = ""]
31827 #[doc = "ID: 387"]
31828 CANFD_FRAME(CANFD_FRAME_DATA),
31829 #[doc = "Modify the filter of what CAN messages to forward over the mavlink. This can be used to make CAN forwarding work well on low bandwidth links. The filtering is applied on bits 8 to 24 of the CAN id (2nd and 3rd bytes) which corresponds to the DroneCAN message ID for DroneCAN. Filters with more than 16 IDs can be constructed by sending multiple CAN_FILTER_MODIFY messages."]
31830 #[doc = ""]
31831 #[doc = "ID: 388"]
31832 CAN_FILTER_MODIFY(CAN_FILTER_MODIFY_DATA),
31833 #[doc = "A forwarded CAN frame as requested by MAV_CMD_CAN_FORWARD."]
31834 #[doc = ""]
31835 #[doc = "ID: 386"]
31836 CAN_FRAME(CAN_FRAME_DATA),
31837 #[doc = "Configure cellular modems. This message is re-emitted as an acknowledgement by the modem. The message may also be explicitly requested using MAV_CMD_REQUEST_MESSAGE."]
31838 #[doc = ""]
31839 #[doc = "ID: 336"]
31840 CELLULAR_CONFIG(CELLULAR_CONFIG_DATA),
31841 #[doc = "Report current used cellular network status."]
31842 #[doc = ""]
31843 #[doc = "ID: 334"]
31844 CELLULAR_STATUS(CELLULAR_STATUS_DATA),
31845 #[doc = "Request to control this MAV."]
31846 #[doc = ""]
31847 #[doc = "ID: 5"]
31848 CHANGE_OPERATOR_CONTROL(CHANGE_OPERATOR_CONTROL_DATA),
31849 #[doc = "Accept / deny control of this MAV."]
31850 #[doc = ""]
31851 #[doc = "ID: 6"]
31852 CHANGE_OPERATOR_CONTROL_ACK(CHANGE_OPERATOR_CONTROL_ACK_DATA),
31853 #[doc = "Information about a potential collision."]
31854 #[doc = ""]
31855 #[doc = "ID: 247"]
31856 COLLISION(COLLISION_DATA),
31857 #[doc = "Report status of a command. Includes feedback whether the command was executed. The command microservice is documented at <https://mavlink.io/en/services/command.html>."]
31858 #[doc = ""]
31859 #[doc = "ID: 77"]
31860 COMMAND_ACK(COMMAND_ACK_DATA),
31861 #[doc = "Cancel a long running command. The target system should respond with a COMMAND_ACK to the original command with result=MAV_RESULT_CANCELLED if the long running process was cancelled. If it has already completed, the cancel action can be ignored. The cancel action can be retried until some sort of acknowledgement to the original command has been received. The command microservice is documented at <https://mavlink.io/en/services/command.html>."]
31862 #[doc = ""]
31863 #[doc = "ID: 80"]
31864 COMMAND_CANCEL(COMMAND_CANCEL_DATA),
31865 #[doc = "Send a command with up to seven parameters to the MAV, where params 5 and 6 are integers and the other values are floats. This is preferred over COMMAND_LONG as it allows the MAV_FRAME to be specified for interpreting positional information, such as altitude. COMMAND_INT is also preferred when sending latitude and longitude data in params 5 and 6, as it allows for greater precision. Param 5 and 6 encode positional data as scaled integers, where the scaling depends on the actual command value. NaN or INT32_MAX may be used in float/integer params (respectively) to indicate optional/default values (e.g. to use the component's current latitude, yaw rather than a specific value). The command microservice is documented at <https://mavlink.io/en/services/command.html>."]
31866 #[doc = ""]
31867 #[doc = "ID: 75"]
31868 COMMAND_INT(COMMAND_INT_DATA),
31869 #[doc = "Send a command with up to seven parameters to the MAV. COMMAND_INT is generally preferred when sending MAV_CMD commands that include positional information; it offers higher precision and allows the MAV_FRAME to be specified (which may otherwise be ambiguous, particularly for altitude). The command microservice is documented at <https://mavlink.io/en/services/command.html>."]
31870 #[doc = ""]
31871 #[doc = "ID: 76"]
31872 COMMAND_LONG(COMMAND_LONG_DATA),
31873 #[doc = "Component information message, which may be requested using MAV_CMD_REQUEST_MESSAGE."]
31874 #[doc = ""]
31875 #[doc = "ID: 395"]
31876 #[deprecated = " See `COMPONENT_METADATA` (Deprecated since 2022-04)"]
31877 COMPONENT_INFORMATION(COMPONENT_INFORMATION_DATA),
31878 #[doc = "Basic component information data. Should be requested using MAV_CMD_REQUEST_MESSAGE on startup, or when required."]
31879 #[doc = ""]
31880 #[doc = "ID: 396"]
31881 COMPONENT_INFORMATION_BASIC(COMPONENT_INFORMATION_BASIC_DATA),
31882 #[doc = "Component metadata message, which may be requested using MAV_CMD_REQUEST_MESSAGE. This contains the MAVLink FTP URI and CRC for the component's general metadata file. The file must be hosted on the component, and may be xz compressed. The file CRC can be used for file caching. The general metadata file can be read to get the locations of other metadata files (COMP_METADATA_TYPE) and translations, which may be hosted either on the vehicle or the internet. For more information see: <https://mavlink.io/en/services/component_information.html>. Note: Camera components should use CAMERA_INFORMATION instead, and autopilots may use both this message and AUTOPILOT_VERSION."]
31883 #[doc = ""]
31884 #[doc = "ID: 397"]
31885 COMPONENT_METADATA(COMPONENT_METADATA_DATA),
31886 #[doc = "The smoothed, monotonic system state used to feed the control loops of the system."]
31887 #[doc = ""]
31888 #[doc = "ID: 146"]
31889 CONTROL_SYSTEM_STATE(CONTROL_SYSTEM_STATE_DATA),
31890 #[doc = "Regular broadcast for the current latest event sequence number for a component. This is used to check for dropped events."]
31891 #[doc = ""]
31892 #[doc = "ID: 411"]
31893 CURRENT_EVENT_SEQUENCE(CURRENT_EVENT_SEQUENCE_DATA),
31894 #[doc = "Get the current mode. This should be emitted on any mode change, and broadcast at low rate (nominally 0.5 Hz). It may be requested using MAV_CMD_REQUEST_MESSAGE. See <https://mavlink.io/en/services/standard_modes.html>."]
31895 #[doc = ""]
31896 #[doc = "ID: 436"]
31897 CURRENT_MODE(CURRENT_MODE_DATA),
31898 #[doc = "Data stream status information."]
31899 #[doc = ""]
31900 #[doc = "ID: 67"]
31901 #[deprecated = " See `MESSAGE_INTERVAL` (Deprecated since 2015-08)"]
31902 DATA_STREAM(DATA_STREAM_DATA),
31903 #[doc = "Handshake message to initiate, control and stop image streaming when using the Image Transmission Protocol: <https://mavlink.io/en/services/image_transmission.html>."]
31904 #[doc = ""]
31905 #[doc = "ID: 130"]
31906 DATA_TRANSMISSION_HANDSHAKE(DATA_TRANSMISSION_HANDSHAKE_DATA),
31907 #[doc = "Send a debug value. The index is used to discriminate between values. These values show up in the plot of QGroundControl as DEBUG N."]
31908 #[doc = ""]
31909 #[doc = "ID: 254"]
31910 DEBUG(DEBUG_DATA),
31911 #[doc = "Large debug/prototyping array. The message uses the maximum available payload for data. The array_id and name fields are used to discriminate between messages in code and in user interfaces (respectively). Do not use in production code."]
31912 #[doc = ""]
31913 #[doc = "ID: 350"]
31914 DEBUG_FLOAT_ARRAY(DEBUG_FLOAT_ARRAY_DATA),
31915 #[doc = "To debug something using a named 3D vector."]
31916 #[doc = ""]
31917 #[doc = "ID: 250"]
31918 DEBUG_VECT(DEBUG_VECT_DATA),
31919 #[doc = "Distance sensor information for an onboard rangefinder."]
31920 #[doc = ""]
31921 #[doc = "ID: 132"]
31922 DISTANCE_SENSOR(DISTANCE_SENSOR_DATA),
31923 #[doc = "EFI status output."]
31924 #[doc = ""]
31925 #[doc = "ID: 225"]
31926 EFI_STATUS(EFI_STATUS_DATA),
31927 #[doc = "Data packet for images sent using the Image Transmission Protocol: <https://mavlink.io/en/services/image_transmission.html>."]
31928 #[doc = ""]
31929 #[doc = "ID: 131"]
31930 ENCAPSULATED_DATA(ENCAPSULATED_DATA_DATA),
31931 #[doc = "ESC information for lower rate streaming. Recommended streaming rate 1Hz. See ESC_STATUS for higher-rate ESC data."]
31932 #[doc = ""]
31933 #[doc = "ID: 290"]
31934 ESC_INFO(ESC_INFO_DATA),
31935 #[doc = "ESC information for higher rate streaming. Recommended streaming rate is ~10 Hz. Information that changes more slowly is sent in ESC_INFO. It should typically only be streamed on high-bandwidth links (i.e. to a companion computer)."]
31936 #[doc = ""]
31937 #[doc = "ID: 291"]
31938 ESC_STATUS(ESC_STATUS_DATA),
31939 #[doc = "Estimator status message including flags, innovation test ratios and estimated accuracies. The flags message is an integer bitmask containing information on which EKF outputs are valid. See the ESTIMATOR_STATUS_FLAGS enum definition for further information. The innovation test ratios show the magnitude of the sensor innovation divided by the innovation check threshold. Under normal operation the innovation test ratios should be below 0.5 with occasional values up to 1.0. Values greater than 1.0 should be rare under normal operation and indicate that a measurement has been rejected by the filter. The user should be notified if an innovation test ratio greater than 1.0 is recorded. Notifications for values in the range between 0.5 and 1.0 should be optional and controllable by the user."]
31940 #[doc = ""]
31941 #[doc = "ID: 230"]
31942 ESTIMATOR_STATUS(ESTIMATOR_STATUS_DATA),
31943 #[doc = "Event message. Each new event from a particular component gets a new sequence number. The same message might be sent multiple times if (re-)requested. Most events are broadcast, some can be specific to a target component (as receivers keep track of the sequence for missed events, all events need to be broadcast. Thus we use destination_component instead of target_component)."]
31944 #[doc = ""]
31945 #[doc = "ID: 410"]
31946 EVENT(EVENT_DATA),
31947 #[doc = "Provides state for additional features."]
31948 #[doc = ""]
31949 #[doc = "ID: 245"]
31950 EXTENDED_SYS_STATE(EXTENDED_SYS_STATE_DATA),
31951 #[doc = "Status of geo-fencing. Sent in extended status stream when fencing enabled."]
31952 #[doc = ""]
31953 #[doc = "ID: 162"]
31954 FENCE_STATUS(FENCE_STATUS_DATA),
31955 #[doc = "File transfer protocol message: <https://mavlink.io/en/services/ftp.html>."]
31956 #[doc = ""]
31957 #[doc = "ID: 110"]
31958 FILE_TRANSFER_PROTOCOL(FILE_TRANSFER_PROTOCOL_DATA),
31959 #[doc = "Flight information. This includes time since boot for arm, takeoff, and land, and a flight number. Takeoff and landing values reset to zero on arm. This can be requested using MAV_CMD_REQUEST_MESSAGE. Note, some fields are misnamed - timestamps are from boot (not UTC) and the flight_uuid is a sequence number."]
31960 #[doc = ""]
31961 #[doc = "ID: 264"]
31962 FLIGHT_INFORMATION(FLIGHT_INFORMATION_DATA),
31963 #[doc = "Current motion information from a designated system."]
31964 #[doc = ""]
31965 #[doc = "ID: 144"]
31966 FOLLOW_TARGET(FOLLOW_TARGET_DATA),
31967 #[doc = "Fuel status. This message provides \"generic\" fuel level information for in a GCS and for triggering failsafes in an autopilot. The fuel type and associated units for fields in this message are defined in the enum MAV_FUEL_TYPE. The reported `consumed_fuel` and `remaining_fuel` must only be supplied if measured: they must not be inferred from the `maximum_fuel` and the other value. A recipient can assume that if these fields are supplied they are accurate. If not provided, the recipient can infer `remaining_fuel` from `maximum_fuel` and `consumed_fuel` on the assumption that the fuel was initially at its maximum (this is what battery monitors assume). Note however that this is an assumption, and the UI should prompt the user appropriately (i.e. notify user that they should fill the tank before boot). This kind of information may also be sent in fuel-specific messages such as BATTERY_STATUS_V2. If both messages are sent for the same fuel system, the ids and corresponding information must match. This should be streamed (nominally at 0.1 Hz)."]
31968 #[doc = ""]
31969 #[doc = "ID: 371"]
31970 FUEL_STATUS(FUEL_STATUS_DATA),
31971 #[doc = "Telemetry of power generation system. Alternator or mechanical generator."]
31972 #[doc = ""]
31973 #[doc = "ID: 373"]
31974 GENERATOR_STATUS(GENERATOR_STATUS_DATA),
31975 #[doc = "Message reporting the status of a gimbal device. \t This message should be broadcast by a gimbal device component at a low regular rate (e.g. 5 Hz). \t For the angles encoded in the quaternion and the angular velocities holds: \t If the flag GIMBAL_DEVICE_FLAGS_YAW_IN_VEHICLE_FRAME is set, then they are relative to the vehicle heading (vehicle frame). \t If the flag GIMBAL_DEVICE_FLAGS_YAW_IN_EARTH_FRAME is set, then they are relative to absolute North (earth frame). \t If neither of these flags are set, then (for backwards compatibility) it holds: \t If the flag GIMBAL_DEVICE_FLAGS_YAW_LOCK is set, then they are relative to absolute North (earth frame), \t else they are relative to the vehicle heading (vehicle frame). \t Other conditions of the flags are not allowed. \t The quaternion and angular velocities in the other frame can be calculated from delta_yaw and delta_yaw_velocity as \t q_earth = q_delta_yaw * q_vehicle and w_earth = w_delta_yaw_velocity + w_vehicle (if not NaN). \t If neither the GIMBAL_DEVICE_FLAGS_YAW_IN_VEHICLE_FRAME nor the GIMBAL_DEVICE_FLAGS_YAW_IN_EARTH_FRAME flag is set, \t then (for backwards compatibility) the data in the delta_yaw and delta_yaw_velocity fields are to be ignored. \t New implementations should always set either GIMBAL_DEVICE_FLAGS_YAW_IN_VEHICLE_FRAME or GIMBAL_DEVICE_FLAGS_YAW_IN_EARTH_FRAME, \t and always should set delta_yaw and delta_yaw_velocity either to the proper value or NaN."]
31976 #[doc = ""]
31977 #[doc = "ID: 285"]
31978 GIMBAL_DEVICE_ATTITUDE_STATUS(GIMBAL_DEVICE_ATTITUDE_STATUS_DATA),
31979 #[doc = "Information about a low level gimbal. This message should be requested by the gimbal manager or a ground station using MAV_CMD_REQUEST_MESSAGE. The maximum angles and rates are the limits by hardware. However, the limits by software used are likely different/smaller and dependent on mode/settings/etc.."]
31980 #[doc = ""]
31981 #[doc = "ID: 283"]
31982 GIMBAL_DEVICE_INFORMATION(GIMBAL_DEVICE_INFORMATION_DATA),
31983 #[doc = "Low level message to control a gimbal device's attitude. \t This message is to be sent from the gimbal manager to the gimbal device component. \t The quaternion and angular velocities can be set to NaN according to use case. \t For the angles encoded in the quaternion and the angular velocities holds: \t If the flag GIMBAL_DEVICE_FLAGS_YAW_IN_VEHICLE_FRAME is set, then they are relative to the vehicle heading (vehicle frame). \t If the flag GIMBAL_DEVICE_FLAGS_YAW_IN_EARTH_FRAME is set, then they are relative to absolute North (earth frame). \t If neither of these flags are set, then (for backwards compatibility) it holds: \t If the flag GIMBAL_DEVICE_FLAGS_YAW_LOCK is set, then they are relative to absolute North (earth frame), \t else they are relative to the vehicle heading (vehicle frame). \t Setting both GIMBAL_DEVICE_FLAGS_YAW_IN_VEHICLE_FRAME and GIMBAL_DEVICE_FLAGS_YAW_IN_EARTH_FRAME is not allowed. \t These rules are to ensure backwards compatibility. \t New implementations should always set either GIMBAL_DEVICE_FLAGS_YAW_IN_VEHICLE_FRAME or GIMBAL_DEVICE_FLAGS_YAW_IN_EARTH_FRAME."]
31984 #[doc = ""]
31985 #[doc = "ID: 284"]
31986 GIMBAL_DEVICE_SET_ATTITUDE(GIMBAL_DEVICE_SET_ATTITUDE_DATA),
31987 #[doc = "Information about a high level gimbal manager. This message should be requested by a ground station using MAV_CMD_REQUEST_MESSAGE."]
31988 #[doc = ""]
31989 #[doc = "ID: 280"]
31990 GIMBAL_MANAGER_INFORMATION(GIMBAL_MANAGER_INFORMATION_DATA),
31991 #[doc = "High level message to control a gimbal's attitude. This message is to be sent to the gimbal manager (e.g. from a ground station). Angles and rates can be set to NaN according to use case."]
31992 #[doc = ""]
31993 #[doc = "ID: 282"]
31994 GIMBAL_MANAGER_SET_ATTITUDE(GIMBAL_MANAGER_SET_ATTITUDE_DATA),
31995 #[doc = "High level message to control a gimbal manually. The angles or angular rates are unitless; the actual rates will depend on internal gimbal manager settings/configuration (e.g. set by parameters). This message is to be sent to the gimbal manager (e.g. from a ground station). Angles and rates can be set to NaN according to use case."]
31996 #[doc = ""]
31997 #[doc = "ID: 288"]
31998 GIMBAL_MANAGER_SET_MANUAL_CONTROL(GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA),
31999 #[doc = "Set gimbal manager pitch and yaw angles (high rate message). This message is to be sent to the gimbal manager (e.g. from a ground station) and will be ignored by gimbal devices. Angles and rates can be set to NaN according to use case. Use MAV_CMD_DO_GIMBAL_MANAGER_PITCHYAW for low-rate adjustments that require confirmation."]
32000 #[doc = ""]
32001 #[doc = "ID: 287"]
32002 GIMBAL_MANAGER_SET_PITCHYAW(GIMBAL_MANAGER_SET_PITCHYAW_DATA),
32003 #[doc = "Current status about a high level gimbal manager. This message should be broadcast at a low regular rate (e.g. 5Hz)."]
32004 #[doc = ""]
32005 #[doc = "ID: 281"]
32006 GIMBAL_MANAGER_STATUS(GIMBAL_MANAGER_STATUS_DATA),
32007 #[doc = "The filtered global position (e.g. fused GPS and accelerometers). The position is in GPS-frame (right-handed, Z-up). It is designed as scaled integer message since the resolution of float is not sufficient."]
32008 #[doc = ""]
32009 #[doc = "ID: 33"]
32010 GLOBAL_POSITION_INT(GLOBAL_POSITION_INT_DATA),
32011 #[doc = "The filtered global position (e.g. fused GPS and accelerometers). The position is in GPS-frame (right-handed, Z-up). It is designed as scaled integer message since the resolution of float is not sufficient. NOTE: This message is intended for onboard networks / companion computers and higher-bandwidth links and optimized for accuracy and completeness. Please use the GLOBAL_POSITION_INT message for a minimal subset."]
32012 #[doc = ""]
32013 #[doc = "ID: 63"]
32014 GLOBAL_POSITION_INT_COV(GLOBAL_POSITION_INT_COV_DATA),
32015 #[doc = "Global position/attitude estimate from a vision source."]
32016 #[doc = ""]
32017 #[doc = "ID: 101"]
32018 GLOBAL_VISION_POSITION_ESTIMATE(GLOBAL_VISION_POSITION_ESTIMATE_DATA),
32019 #[doc = "Second GPS data."]
32020 #[doc = ""]
32021 #[doc = "ID: 124"]
32022 GPS2_RAW(GPS2_RAW_DATA),
32023 #[doc = "RTK GPS data. Gives information on the relative baseline calculation the GPS is reporting."]
32024 #[doc = ""]
32025 #[doc = "ID: 128"]
32026 GPS2_RTK(GPS2_RTK_DATA),
32027 #[doc = "Publishes the GPS coordinates of the vehicle local origin (0,0,0) position. Emitted whenever a new GPS-Local position mapping is requested or set - e.g. following SET_GPS_GLOBAL_ORIGIN message."]
32028 #[doc = ""]
32029 #[doc = "ID: 49"]
32030 GPS_GLOBAL_ORIGIN(GPS_GLOBAL_ORIGIN_DATA),
32031 #[doc = "Data for injecting into the onboard GPS (used for DGPS)."]
32032 #[doc = ""]
32033 #[doc = "ID: 123"]
32034 #[deprecated = " See `GPS_RTCM_DATA` (Deprecated since 2022-05)"]
32035 GPS_INJECT_DATA(GPS_INJECT_DATA_DATA),
32036 #[doc = "GPS sensor input message. This is a raw sensor value sent by the GPS. This is NOT the global position estimate of the system."]
32037 #[doc = ""]
32038 #[doc = "ID: 232"]
32039 GPS_INPUT(GPS_INPUT_DATA),
32040 #[doc = "The global position, as returned by the Global Positioning System (GPS). This is NOT the global position estimate of the system, but rather a RAW sensor value. See message GLOBAL_POSITION_INT for the global position estimate."]
32041 #[doc = ""]
32042 #[doc = "ID: 24"]
32043 GPS_RAW_INT(GPS_RAW_INT_DATA),
32044 #[doc = "RTCM message for injecting into the onboard GPS (used for DGPS)."]
32045 #[doc = ""]
32046 #[doc = "ID: 233"]
32047 GPS_RTCM_DATA(GPS_RTCM_DATA_DATA),
32048 #[doc = "RTK GPS data. Gives information on the relative baseline calculation the GPS is reporting."]
32049 #[doc = ""]
32050 #[doc = "ID: 127"]
32051 GPS_RTK(GPS_RTK_DATA),
32052 #[doc = "The positioning status, as reported by GPS. This message is intended to display status information about each satellite visible to the receiver. See message GLOBAL_POSITION_INT for the global position estimate. This message can contain information for up to 20 satellites."]
32053 #[doc = ""]
32054 #[doc = "ID: 25"]
32055 GPS_STATUS(GPS_STATUS_DATA),
32056 #[doc = "The heartbeat message shows that a system or component is present and responding. The type and autopilot fields (along with the message component id), allow the receiving system to treat further messages from this system appropriately (e.g. by laying out the user interface based on the autopilot). This microservice is documented at <https://mavlink.io/en/services/heartbeat.html>."]
32057 #[doc = ""]
32058 #[doc = "ID: 0"]
32059 HEARTBEAT(HEARTBEAT_DATA),
32060 #[doc = "The IMU readings in SI units in NED body frame."]
32061 #[doc = ""]
32062 #[doc = "ID: 105"]
32063 HIGHRES_IMU(HIGHRES_IMU_DATA),
32064 #[doc = "Message appropriate for high latency connections like Iridium."]
32065 #[doc = ""]
32066 #[doc = "ID: 234"]
32067 #[deprecated = " See `HIGH_LATENCY2` (Deprecated since 2020-10)"]
32068 HIGH_LATENCY(HIGH_LATENCY_DATA),
32069 #[doc = "Message appropriate for high latency connections like Iridium (version 2)."]
32070 #[doc = ""]
32071 #[doc = "ID: 235"]
32072 HIGH_LATENCY2(HIGH_LATENCY2_DATA),
32073 #[doc = "Sent from autopilot to simulation. Hardware in the loop control outputs. Alternative to HIL_CONTROLS."]
32074 #[doc = ""]
32075 #[doc = "ID: 93"]
32076 HIL_ACTUATOR_CONTROLS(HIL_ACTUATOR_CONTROLS_DATA),
32077 #[doc = "Sent from autopilot to simulation. Hardware in the loop control outputs. Alternative to HIL_ACTUATOR_CONTROLS."]
32078 #[doc = ""]
32079 #[doc = "ID: 91"]
32080 HIL_CONTROLS(HIL_CONTROLS_DATA),
32081 #[doc = "The global position, as returned by the Global Positioning System (GPS). This is NOT the global position estimate of the system, but rather a RAW sensor value. See message GLOBAL_POSITION_INT for the global position estimate."]
32082 #[doc = ""]
32083 #[doc = "ID: 113"]
32084 HIL_GPS(HIL_GPS_DATA),
32085 #[doc = "Simulated optical flow from a flow sensor (e.g. PX4FLOW or optical mouse sensor)."]
32086 #[doc = ""]
32087 #[doc = "ID: 114"]
32088 HIL_OPTICAL_FLOW(HIL_OPTICAL_FLOW_DATA),
32089 #[doc = "Sent from simulation to autopilot. The RAW values of the RC channels received. The standard PPM modulation is as follows: 1000 microseconds: 0%, 2000 microseconds: 100%. Individual receivers/transmitters might violate this specification."]
32090 #[doc = ""]
32091 #[doc = "ID: 92"]
32092 HIL_RC_INPUTS_RAW(HIL_RC_INPUTS_RAW_DATA),
32093 #[doc = "The IMU readings in SI units in NED body frame."]
32094 #[doc = ""]
32095 #[doc = "ID: 107"]
32096 HIL_SENSOR(HIL_SENSOR_DATA),
32097 #[doc = "Sent from simulation to autopilot. This packet is useful for high throughput applications such as hardware in the loop simulations."]
32098 #[doc = ""]
32099 #[doc = "ID: 90"]
32100 #[deprecated = "Suffers from missing airspeed fields and singularities due to Euler angles. See `HIL_STATE_QUATERNION` (Deprecated since 2013-07)"]
32101 HIL_STATE(HIL_STATE_DATA),
32102 #[doc = "Sent from simulation to autopilot, avoids in contrast to HIL_STATE singularities. This packet is useful for high throughput applications such as hardware in the loop simulations."]
32103 #[doc = ""]
32104 #[doc = "ID: 115"]
32105 HIL_STATE_QUATERNION(HIL_STATE_QUATERNION_DATA),
32106 #[doc = "Contains the home position. \tThe home position is the default position that the system will return to and land on. \tThe position must be set automatically by the system during the takeoff, and may also be explicitly set using MAV_CMD_DO_SET_HOME. \tThe global and local positions encode the position in the respective coordinate frames, while the q parameter encodes the orientation of the surface. \tUnder normal conditions it describes the heading and terrain slope, which can be used by the aircraft to adjust the approach. \tThe approach 3D vector describes the point to which the system should fly in normal flight mode and then perform a landing sequence along the vector. Note: this message can be requested by sending the MAV_CMD_REQUEST_MESSAGE with param1=242 (or the deprecated MAV_CMD_GET_HOME_POSITION command)."]
32107 #[doc = ""]
32108 #[doc = "ID: 242"]
32109 HOME_POSITION(HOME_POSITION_DATA),
32110 #[doc = "Temperature and humidity from hygrometer."]
32111 #[doc = ""]
32112 #[doc = "ID: 12920"]
32113 HYGROMETER_SENSOR(HYGROMETER_SENSOR_DATA),
32114 #[doc = "Illuminator status."]
32115 #[doc = ""]
32116 #[doc = "ID: 440"]
32117 ILLUMINATOR_STATUS(ILLUMINATOR_STATUS_DATA),
32118 #[doc = "Status of the Iridium SBD link."]
32119 #[doc = ""]
32120 #[doc = "ID: 335"]
32121 ISBD_LINK_STATUS(ISBD_LINK_STATUS_DATA),
32122 #[doc = "The location of a landing target. See: <https://mavlink.io/en/services/landing_target.html>."]
32123 #[doc = ""]
32124 #[doc = "ID: 149"]
32125 LANDING_TARGET(LANDING_TARGET_DATA),
32126 #[doc = "Status generated in each node in the communication chain and injected into MAVLink stream."]
32127 #[doc = ""]
32128 #[doc = "ID: 8"]
32129 LINK_NODE_STATUS(LINK_NODE_STATUS_DATA),
32130 #[doc = "The filtered local position (e.g. fused computer vision and accelerometers). Coordinate frame is right-handed, Z-axis down (aeronautical frame, NED / north-east-down convention)."]
32131 #[doc = ""]
32132 #[doc = "ID: 32"]
32133 LOCAL_POSITION_NED(LOCAL_POSITION_NED_DATA),
32134 #[doc = "The filtered local position (e.g. fused computer vision and accelerometers). Coordinate frame is right-handed, Z-axis down (aeronautical frame, NED / north-east-down convention)."]
32135 #[doc = ""]
32136 #[doc = "ID: 64"]
32137 LOCAL_POSITION_NED_COV(LOCAL_POSITION_NED_COV_DATA),
32138 #[doc = "The offset in X, Y, Z and yaw between the LOCAL_POSITION_NED messages of MAV X and the global coordinate frame in NED coordinates. Coordinate frame is right-handed, Z-axis down (aeronautical frame, NED / north-east-down convention)."]
32139 #[doc = ""]
32140 #[doc = "ID: 89"]
32141 LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET(LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA),
32142 #[doc = "An ack for a LOGGING_DATA_ACKED message."]
32143 #[doc = ""]
32144 #[doc = "ID: 268"]
32145 LOGGING_ACK(LOGGING_ACK_DATA),
32146 #[doc = "A message containing logged data (see also MAV_CMD_LOGGING_START)."]
32147 #[doc = ""]
32148 #[doc = "ID: 266"]
32149 LOGGING_DATA(LOGGING_DATA_DATA),
32150 #[doc = "A message containing logged data which requires a LOGGING_ACK to be sent back."]
32151 #[doc = ""]
32152 #[doc = "ID: 267"]
32153 LOGGING_DATA_ACKED(LOGGING_DATA_ACKED_DATA),
32154 #[doc = "Reply to LOG_REQUEST_DATA."]
32155 #[doc = ""]
32156 #[doc = "ID: 120"]
32157 LOG_DATA(LOG_DATA_DATA),
32158 #[doc = "Reply to LOG_REQUEST_LIST."]
32159 #[doc = ""]
32160 #[doc = "ID: 118"]
32161 LOG_ENTRY(LOG_ENTRY_DATA),
32162 #[doc = "Erase all logs."]
32163 #[doc = ""]
32164 #[doc = "ID: 121"]
32165 LOG_ERASE(LOG_ERASE_DATA),
32166 #[doc = "Request a chunk of a log."]
32167 #[doc = ""]
32168 #[doc = "ID: 119"]
32169 LOG_REQUEST_DATA(LOG_REQUEST_DATA_DATA),
32170 #[doc = "Stop log transfer and resume normal logging."]
32171 #[doc = ""]
32172 #[doc = "ID: 122"]
32173 LOG_REQUEST_END(LOG_REQUEST_END_DATA),
32174 #[doc = "Request a list of available logs. On some systems calling this may stop on-board logging until LOG_REQUEST_END is called. If there are no log files available this request shall be answered with one LOG_ENTRY message with id = 0 and num_logs = 0."]
32175 #[doc = ""]
32176 #[doc = "ID: 117"]
32177 LOG_REQUEST_LIST(LOG_REQUEST_LIST_DATA),
32178 #[doc = "Reports results of completed compass calibration. Sent until MAG_CAL_ACK received."]
32179 #[doc = ""]
32180 #[doc = "ID: 192"]
32181 MAG_CAL_REPORT(MAG_CAL_REPORT_DATA),
32182 #[doc = "This message provides an API for manually controlling the vehicle using standard joystick axes nomenclature, along with a joystick-like input device. Unused axes can be disabled and buttons states are transmitted as individual on/off bits of a bitmask."]
32183 #[doc = ""]
32184 #[doc = "ID: 69"]
32185 MANUAL_CONTROL(MANUAL_CONTROL_DATA),
32186 #[doc = "Setpoint in roll, pitch, yaw and thrust from the operator."]
32187 #[doc = ""]
32188 #[doc = "ID: 81"]
32189 MANUAL_SETPOINT(MANUAL_SETPOINT_DATA),
32190 #[doc = "Send raw controller memory. The use of this message is discouraged for normal packets, but a quite efficient way for testing new messages and getting experimental debug output."]
32191 #[doc = ""]
32192 #[doc = "ID: 249"]
32193 MEMORY_VECT(MEMORY_VECT_DATA),
32194 #[doc = "The interval between messages for a particular MAVLink message ID. This message is sent in response to the MAV_CMD_REQUEST_MESSAGE command with param1=244 (this message) and param2=message_id (the id of the message for which the interval is required). \tIt may also be sent in response to MAV_CMD_GET_MESSAGE_INTERVAL. \tThis interface replaces DATA_STREAM."]
32195 #[doc = ""]
32196 #[doc = "ID: 244"]
32197 MESSAGE_INTERVAL(MESSAGE_INTERVAL_DATA),
32198 #[doc = "Acknowledgment message during waypoint handling. The type field states if this message is a positive ack (type=0) or if an error happened (type=non-zero)."]
32199 #[doc = ""]
32200 #[doc = "ID: 47"]
32201 MISSION_ACK(MISSION_ACK_DATA),
32202 #[doc = "Delete all mission items at once."]
32203 #[doc = ""]
32204 #[doc = "ID: 45"]
32205 MISSION_CLEAR_ALL(MISSION_CLEAR_ALL_DATA),
32206 #[doc = "This message is emitted as response to MISSION_REQUEST_LIST by the MAV and to initiate a write transaction. The GCS can then request the individual mission item based on the knowledge of the total number of waypoints."]
32207 #[doc = ""]
32208 #[doc = "ID: 44"]
32209 MISSION_COUNT(MISSION_COUNT_DATA),
32210 #[doc = "Message that announces the sequence number of the current target mission item (that the system will fly towards/execute when the mission is running). This message should be streamed all the time (nominally at 1Hz). This message should be emitted following a call to MAV_CMD_DO_SET_MISSION_CURRENT or MISSION_SET_CURRENT."]
32211 #[doc = ""]
32212 #[doc = "ID: 42"]
32213 MISSION_CURRENT(MISSION_CURRENT_DATA),
32214 #[doc = "Message encoding a mission item. This message is emitted to announce the presence of a mission item and to set a mission item on the system. The mission item can be either in x, y, z meters (type: LOCAL) or x:lat, y:lon, z:altitude. Local frame is Z-down, right handed (NED), global frame is Z-up, right handed (ENU). NaN may be used to indicate an optional/default value (e.g. to use the system's current latitude or yaw rather than a specific value). See also <https://mavlink.io/en/services/mission.html>."]
32215 #[doc = ""]
32216 #[doc = "ID: 39"]
32217 #[deprecated = " See `MISSION_ITEM_INT` (Deprecated since 2020-06)"]
32218 MISSION_ITEM(MISSION_ITEM_DATA),
32219 #[doc = "Message encoding a mission item. This message is emitted to announce the presence of a mission item and to set a mission item on the system. The mission item can be either in x, y, z meters (type: LOCAL) or x:lat, y:lon, z:altitude. Local frame is Z-down, right handed (NED), global frame is Z-up, right handed (ENU). NaN or INT32_MAX may be used in float/integer params (respectively) to indicate optional/default values (e.g. to use the component's current latitude, yaw rather than a specific value). See also <https://mavlink.io/en/services/mission.html>."]
32220 #[doc = ""]
32221 #[doc = "ID: 73"]
32222 MISSION_ITEM_INT(MISSION_ITEM_INT_DATA),
32223 #[doc = "A certain mission item has been reached. The system will either hold this position (or circle on the orbit) or (if the autocontinue on the WP was set) continue to the next waypoint."]
32224 #[doc = ""]
32225 #[doc = "ID: 46"]
32226 MISSION_ITEM_REACHED(MISSION_ITEM_REACHED_DATA),
32227 #[doc = "Request the information of the mission item with the sequence number seq. The response of the system to this message should be a MISSION_ITEM message. <https://mavlink.io/en/services/mission.html>."]
32228 #[doc = ""]
32229 #[doc = "ID: 40"]
32230 #[deprecated = "A system that gets this request should respond with MISSION_ITEM_INT (as though MISSION_REQUEST_INT was received). See `MISSION_REQUEST_INT` (Deprecated since 2020-06)"]
32231 MISSION_REQUEST(MISSION_REQUEST_DATA),
32232 #[doc = "Request the information of the mission item with the sequence number seq. The response of the system to this message should be a MISSION_ITEM_INT message. <https://mavlink.io/en/services/mission.html>."]
32233 #[doc = ""]
32234 #[doc = "ID: 51"]
32235 MISSION_REQUEST_INT(MISSION_REQUEST_INT_DATA),
32236 #[doc = "Request the overall list of mission items from the system/component."]
32237 #[doc = ""]
32238 #[doc = "ID: 43"]
32239 MISSION_REQUEST_LIST(MISSION_REQUEST_LIST_DATA),
32240 #[doc = "Request a partial list of mission items from the system/component. <https://mavlink.io/en/services/mission.html>. If start and end index are the same, just send one waypoint."]
32241 #[doc = ""]
32242 #[doc = "ID: 37"]
32243 MISSION_REQUEST_PARTIAL_LIST(MISSION_REQUEST_PARTIAL_LIST_DATA),
32244 #[doc = "Set the mission item with sequence number seq as the current item and emit MISSION_CURRENT (whether or not the mission number changed). If a mission is currently being executed, the system will continue to this new mission item on the shortest path, skipping any intermediate mission items. Note that mission jump repeat counters are not reset (see MAV_CMD_DO_JUMP param2). This message may trigger a mission state-machine change on some systems: for example from MISSION_STATE_NOT_STARTED or MISSION_STATE_PAUSED to MISSION_STATE_ACTIVE. If the system is in mission mode, on those systems this command might therefore start, restart or resume the mission. If the system is not in mission mode this message must not trigger a switch to mission mode."]
32245 #[doc = ""]
32246 #[doc = "ID: 41"]
32247 #[deprecated = " See `MAV_CMD_DO_SET_MISSION_CURRENT` (Deprecated since 2022-08)"]
32248 MISSION_SET_CURRENT(MISSION_SET_CURRENT_DATA),
32249 #[doc = "This message is sent to the MAV to write a partial list. If start index == end index, only one item will be transmitted / updated. If the start index is NOT 0 and above the current list size, this request should be REJECTED!."]
32250 #[doc = ""]
32251 #[doc = "ID: 38"]
32252 MISSION_WRITE_PARTIAL_LIST(MISSION_WRITE_PARTIAL_LIST_DATA),
32253 #[doc = "Orientation of a mount."]
32254 #[doc = ""]
32255 #[doc = "ID: 265"]
32256 #[deprecated = "This message is being superseded by MAV_CMD_DO_GIMBAL_MANAGER_PITCHYAW. The message can still be used to communicate with legacy gimbals implementing it. See `MAV_CMD_DO_GIMBAL_MANAGER_PITCHYAW` (Deprecated since 2020-01)"]
32257 MOUNT_ORIENTATION(MOUNT_ORIENTATION_DATA),
32258 #[doc = "Send a key-value pair as float. The use of this message is discouraged for normal packets, but a quite efficient way for testing new messages and getting experimental debug output."]
32259 #[doc = ""]
32260 #[doc = "ID: 251"]
32261 NAMED_VALUE_FLOAT(NAMED_VALUE_FLOAT_DATA),
32262 #[doc = "Send a key-value pair as integer. The use of this message is discouraged for normal packets, but a quite efficient way for testing new messages and getting experimental debug output."]
32263 #[doc = ""]
32264 #[doc = "ID: 252"]
32265 NAMED_VALUE_INT(NAMED_VALUE_INT_DATA),
32266 #[doc = "The state of the navigation and position controller."]
32267 #[doc = ""]
32268 #[doc = "ID: 62"]
32269 NAV_CONTROLLER_OUTPUT(NAV_CONTROLLER_OUTPUT_DATA),
32270 #[doc = "Obstacle distances in front of the sensor, starting from the left in increment degrees to the right."]
32271 #[doc = ""]
32272 #[doc = "ID: 330"]
32273 OBSTACLE_DISTANCE(OBSTACLE_DISTANCE_DATA),
32274 #[doc = "Odometry message to communicate odometry information with an external interface. Fits ROS REP 147 standard for aerial vehicles (<http://www.ros.org/reps/rep-0147.html>)."]
32275 #[doc = ""]
32276 #[doc = "ID: 331"]
32277 ODOMETRY(ODOMETRY_DATA),
32278 #[doc = "Hardware status sent by an onboard computer."]
32279 #[doc = ""]
32280 #[doc = "ID: 390"]
32281 ONBOARD_COMPUTER_STATUS(ONBOARD_COMPUTER_STATUS_DATA),
32282 #[doc = "Transmitter (remote ID system) is enabled and ready to start sending location and other required information. This is streamed by transmitter. A flight controller uses it as a condition to arm."]
32283 #[doc = ""]
32284 #[doc = "ID: 12918"]
32285 OPEN_DRONE_ID_ARM_STATUS(OPEN_DRONE_ID_ARM_STATUS_DATA),
32286 #[doc = "Data for filling the OpenDroneID Authentication message. The Authentication Message defines a field that can provide a means of authenticity for the identity of the UAS (Unmanned Aircraft System). The Authentication message can have two different formats. For data page 0, the fields PageCount, Length and TimeStamp are present and AuthData is only 17 bytes. For data page 1 through 15, PageCount, Length and TimeStamp are not present and the size of AuthData is 23 bytes."]
32287 #[doc = ""]
32288 #[doc = "ID: 12902"]
32289 OPEN_DRONE_ID_AUTHENTICATION(OPEN_DRONE_ID_AUTHENTICATION_DATA),
32290 #[doc = "Data for filling the OpenDroneID Basic ID message. This and the below messages are primarily meant for feeding data to/from an OpenDroneID implementation. E.g. <https://github.com/opendroneid/opendroneid-core-c>. These messages are compatible with the ASTM F3411 Remote ID standard and the ASD-STAN prEN 4709-002 Direct Remote ID standard. Additional information and usage of these messages is documented at <https://mavlink.io/en/services/opendroneid.html>."]
32291 #[doc = ""]
32292 #[doc = "ID: 12900"]
32293 OPEN_DRONE_ID_BASIC_ID(OPEN_DRONE_ID_BASIC_ID_DATA),
32294 #[doc = "Data for filling the OpenDroneID Location message. The float data types are 32-bit IEEE 754. The Location message provides the location, altitude, direction and speed of the aircraft."]
32295 #[doc = ""]
32296 #[doc = "ID: 12901"]
32297 OPEN_DRONE_ID_LOCATION(OPEN_DRONE_ID_LOCATION_DATA),
32298 #[doc = "An OpenDroneID message pack is a container for multiple encoded OpenDroneID messages (i.e. not in the format given for the above message descriptions but after encoding into the compressed OpenDroneID byte format). Used e.g. when transmitting on Bluetooth 5.0 Long Range/Extended Advertising or on WiFi Neighbor Aware Networking or on WiFi Beacon."]
32299 #[doc = ""]
32300 #[doc = "ID: 12915"]
32301 OPEN_DRONE_ID_MESSAGE_PACK(OPEN_DRONE_ID_MESSAGE_PACK_DATA),
32302 #[doc = "Data for filling the OpenDroneID Operator ID message, which contains the CAA (Civil Aviation Authority) issued operator ID."]
32303 #[doc = ""]
32304 #[doc = "ID: 12905"]
32305 OPEN_DRONE_ID_OPERATOR_ID(OPEN_DRONE_ID_OPERATOR_ID_DATA),
32306 #[doc = "Data for filling the OpenDroneID Self ID message. The Self ID Message is an opportunity for the operator to (optionally) declare their identity and purpose of the flight. This message can provide additional information that could reduce the threat profile of a UA (Unmanned Aircraft) flying in a particular area or manner. This message can also be used to provide optional additional clarification in an emergency/remote ID system failure situation."]
32307 #[doc = ""]
32308 #[doc = "ID: 12903"]
32309 OPEN_DRONE_ID_SELF_ID(OPEN_DRONE_ID_SELF_ID_DATA),
32310 #[doc = "Data for filling the OpenDroneID System message. The System Message contains general system information including the operator location/altitude and possible aircraft group and/or category/class information."]
32311 #[doc = ""]
32312 #[doc = "ID: 12904"]
32313 OPEN_DRONE_ID_SYSTEM(OPEN_DRONE_ID_SYSTEM_DATA),
32314 #[doc = "Update the data in the OPEN_DRONE_ID_SYSTEM message with new location information. This can be sent to update the location information for the operator when no other information in the SYSTEM message has changed. This message allows for efficient operation on radio links which have limited uplink bandwidth while meeting requirements for update frequency of the operator location."]
32315 #[doc = ""]
32316 #[doc = "ID: 12919"]
32317 OPEN_DRONE_ID_SYSTEM_UPDATE(OPEN_DRONE_ID_SYSTEM_UPDATE_DATA),
32318 #[doc = "Optical flow from a flow sensor (e.g. optical mouse sensor)."]
32319 #[doc = ""]
32320 #[doc = "ID: 100"]
32321 OPTICAL_FLOW(OPTICAL_FLOW_DATA),
32322 #[doc = "Optical flow from an angular rate flow sensor (e.g. PX4FLOW or mouse sensor)."]
32323 #[doc = ""]
32324 #[doc = "ID: 106"]
32325 OPTICAL_FLOW_RAD(OPTICAL_FLOW_RAD_DATA),
32326 #[doc = "Vehicle status report that is sent out while orbit execution is in progress (see MAV_CMD_DO_ORBIT)."]
32327 #[doc = ""]
32328 #[doc = "ID: 360"]
32329 ORBIT_EXECUTION_STATUS(ORBIT_EXECUTION_STATUS_DATA),
32330 #[doc = "Response from a PARAM_EXT_SET message."]
32331 #[doc = ""]
32332 #[doc = "ID: 324"]
32333 PARAM_EXT_ACK(PARAM_EXT_ACK_DATA),
32334 #[doc = "Request all parameters of this component. All parameters should be emitted in response as PARAM_EXT_VALUE."]
32335 #[doc = ""]
32336 #[doc = "ID: 321"]
32337 PARAM_EXT_REQUEST_LIST(PARAM_EXT_REQUEST_LIST_DATA),
32338 #[doc = "Request to read the value of a parameter with either the param_id string id or param_index. PARAM_EXT_VALUE should be emitted in response."]
32339 #[doc = ""]
32340 #[doc = "ID: 320"]
32341 PARAM_EXT_REQUEST_READ(PARAM_EXT_REQUEST_READ_DATA),
32342 #[doc = "Set a parameter value. In order to deal with message loss (and retransmission of PARAM_EXT_SET), when setting a parameter value and the new value is the same as the current value, you will immediately get a PARAM_ACK_ACCEPTED response. If the current state is PARAM_ACK_IN_PROGRESS, you will accordingly receive a PARAM_ACK_IN_PROGRESS in response."]
32343 #[doc = ""]
32344 #[doc = "ID: 323"]
32345 PARAM_EXT_SET(PARAM_EXT_SET_DATA),
32346 #[doc = "Emit the value of a parameter. The inclusion of param_count and param_index in the message allows the recipient to keep track of received parameters and allows them to re-request missing parameters after a loss or timeout."]
32347 #[doc = ""]
32348 #[doc = "ID: 322"]
32349 PARAM_EXT_VALUE(PARAM_EXT_VALUE_DATA),
32350 #[doc = "Bind a RC channel to a parameter. The parameter should change according to the RC channel value."]
32351 #[doc = ""]
32352 #[doc = "ID: 50"]
32353 PARAM_MAP_RC(PARAM_MAP_RC_DATA),
32354 #[doc = "Request all parameters of this component. After this request, all parameters are emitted. The parameter microservice is documented at <https://mavlink.io/en/services/parameter.html>."]
32355 #[doc = ""]
32356 #[doc = "ID: 21"]
32357 PARAM_REQUEST_LIST(PARAM_REQUEST_LIST_DATA),
32358 #[doc = "value[float]. This allows to send a parameter to any other component (such as the GCS) without the need of previous knowledge of possible parameter names. Thus the same GCS can store different parameters for different autopilots. See also <https://mavlink.io/en/services/parameter.html> for a full documentation of QGroundControl and IMU code."]
32359 #[doc = ""]
32360 #[doc = "ID: 20"]
32361 PARAM_REQUEST_READ(PARAM_REQUEST_READ_DATA),
32362 #[doc = "Set a parameter value (write new value to permanent storage). The receiving component should acknowledge the new parameter value by broadcasting a PARAM_VALUE message (broadcasting ensures that multiple GCS all have an up-to-date list of all parameters). If the sending GCS did not receive a PARAM_VALUE within its timeout time, it should re-send the PARAM_SET message. The parameter microservice is documented at <https://mavlink.io/en/services/parameter.html>."]
32363 #[doc = ""]
32364 #[doc = "ID: 23"]
32365 PARAM_SET(PARAM_SET_DATA),
32366 #[doc = "Emit the value of a onboard parameter. The inclusion of param_count and param_index in the message allows the recipient to keep track of received parameters and allows him to re-request missing parameters after a loss or timeout. The parameter microservice is documented at <https://mavlink.io/en/services/parameter.html>."]
32367 #[doc = ""]
32368 #[doc = "ID: 22"]
32369 PARAM_VALUE(PARAM_VALUE_DATA),
32370 #[doc = "A ping message either requesting or responding to a ping. This allows to measure the system latencies, including serial port, radio modem and UDP connections. The ping microservice is documented at <https://mavlink.io/en/services/ping.html>."]
32371 #[doc = ""]
32372 #[doc = "ID: 4"]
32373 #[deprecated = "To be removed / merged with TIMESYNC. See `TIMESYNC` (Deprecated since 2011-08)"]
32374 PING(PING_DATA),
32375 #[doc = "Control vehicle tone generation (buzzer)."]
32376 #[doc = ""]
32377 #[doc = "ID: 258"]
32378 #[deprecated = "New version explicitly defines format. More interoperable. See `PLAY_TUNE_V2` (Deprecated since 2019-10)"]
32379 PLAY_TUNE(PLAY_TUNE_DATA),
32380 #[doc = "Play vehicle tone/tune (buzzer). Supersedes message PLAY_TUNE."]
32381 #[doc = ""]
32382 #[doc = "ID: 400"]
32383 PLAY_TUNE_V2(PLAY_TUNE_V2_DATA),
32384 #[doc = "Reports the current commanded vehicle position, velocity, and acceleration as specified by the autopilot. This should match the commands sent in SET_POSITION_TARGET_GLOBAL_INT if the vehicle is being controlled this way."]
32385 #[doc = ""]
32386 #[doc = "ID: 87"]
32387 POSITION_TARGET_GLOBAL_INT(POSITION_TARGET_GLOBAL_INT_DATA),
32388 #[doc = "Reports the current commanded vehicle position, velocity, and acceleration as specified by the autopilot. This should match the commands sent in SET_POSITION_TARGET_LOCAL_NED if the vehicle is being controlled this way."]
32389 #[doc = ""]
32390 #[doc = "ID: 85"]
32391 POSITION_TARGET_LOCAL_NED(POSITION_TARGET_LOCAL_NED_DATA),
32392 #[doc = "Power supply status."]
32393 #[doc = ""]
32394 #[doc = "ID: 125"]
32395 POWER_STATUS(POWER_STATUS_DATA),
32396 #[doc = "Version and capability of protocol version. This message can be requested with MAV_CMD_REQUEST_MESSAGE and is used as part of the handshaking to establish which MAVLink version should be used on the network. Every node should respond to a request for PROTOCOL_VERSION to enable the handshaking. Library implementers should consider adding this into the default decoding state machine to allow the protocol core to respond directly."]
32397 #[doc = ""]
32398 #[doc = "ID: 300"]
32399 PROTOCOL_VERSION(PROTOCOL_VERSION_DATA),
32400 #[doc = "Status generated by radio and injected into MAVLink stream."]
32401 #[doc = ""]
32402 #[doc = "ID: 109"]
32403 RADIO_STATUS(RADIO_STATUS_DATA),
32404 #[doc = "The RAW IMU readings for a 9DOF sensor, which is identified by the id (default IMU1). This message should always contain the true raw values without any scaling to allow data capture and system debugging."]
32405 #[doc = ""]
32406 #[doc = "ID: 27"]
32407 RAW_IMU(RAW_IMU_DATA),
32408 #[doc = "The RAW pressure readings for the typical setup of one absolute pressure and one differential pressure sensor. The sensor values should be the raw, UNSCALED ADC values."]
32409 #[doc = ""]
32410 #[doc = "ID: 28"]
32411 RAW_PRESSURE(RAW_PRESSURE_DATA),
32412 #[doc = "RPM sensor data message."]
32413 #[doc = ""]
32414 #[doc = "ID: 339"]
32415 RAW_RPM(RAW_RPM_DATA),
32416 #[doc = "The PPM values of the RC channels received. The standard PPM modulation is as follows: 1000 microseconds: 0%, 2000 microseconds: 100%. A value of UINT16_MAX implies the channel is unused. Individual receivers/transmitters might violate this specification."]
32417 #[doc = ""]
32418 #[doc = "ID: 65"]
32419 RC_CHANNELS(RC_CHANNELS_DATA),
32420 #[doc = "The RAW values of the RC channels sent to the MAV to override info received from the RC radio. The standard PPM modulation is as follows: 1000 microseconds: 0%, 2000 microseconds: 100%. Individual receivers/transmitters might violate this specification. Note carefully the semantic differences between the first 8 channels and the subsequent channels."]
32421 #[doc = ""]
32422 #[doc = "ID: 70"]
32423 RC_CHANNELS_OVERRIDE(RC_CHANNELS_OVERRIDE_DATA),
32424 #[doc = "The RAW values of the RC channels received. The standard PPM modulation is as follows: 1000 microseconds: 0%, 2000 microseconds: 100%. A value of UINT16_MAX implies the channel is unused. Individual receivers/transmitters might violate this specification."]
32425 #[doc = ""]
32426 #[doc = "ID: 35"]
32427 RC_CHANNELS_RAW(RC_CHANNELS_RAW_DATA),
32428 #[doc = "The scaled values of the RC channels received: (-100%) -10000, (0%) 0, (100%) 10000. Channels that are inactive should be set to INT16_MAX."]
32429 #[doc = ""]
32430 #[doc = "ID: 34"]
32431 RC_CHANNELS_SCALED(RC_CHANNELS_SCALED_DATA),
32432 #[doc = "Request a data stream."]
32433 #[doc = ""]
32434 #[doc = "ID: 66"]
32435 #[deprecated = " See `MAV_CMD_SET_MESSAGE_INTERVAL ` (Deprecated since 2015-08)"]
32436 REQUEST_DATA_STREAM(REQUEST_DATA_STREAM_DATA),
32437 #[doc = "Request one or more events to be (re-)sent. If first_sequence==last_sequence, only a single event is requested. Note that first_sequence can be larger than last_sequence (because the sequence number can wrap). Each sequence will trigger an EVENT or EVENT_ERROR response."]
32438 #[doc = ""]
32439 #[doc = "ID: 412"]
32440 REQUEST_EVENT(REQUEST_EVENT_DATA),
32441 #[doc = "The autopilot is requesting a resource (file, binary, other type of data)."]
32442 #[doc = ""]
32443 #[doc = "ID: 142"]
32444 RESOURCE_REQUEST(RESOURCE_REQUEST_DATA),
32445 #[doc = "Response to a REQUEST_EVENT in case of an error (e.g. the event is not available anymore)."]
32446 #[doc = ""]
32447 #[doc = "ID: 413"]
32448 RESPONSE_EVENT_ERROR(RESPONSE_EVENT_ERROR_DATA),
32449 #[doc = "Read out the safety zone the MAV currently assumes."]
32450 #[doc = ""]
32451 #[doc = "ID: 55"]
32452 SAFETY_ALLOWED_AREA(SAFETY_ALLOWED_AREA_DATA),
32453 #[doc = "Set a safety zone (volume), which is defined by two corners of a cube. This message can be used to tell the MAV which setpoints/waypoints to accept and which to reject. Safety areas are often enforced by national or competition regulations."]
32454 #[doc = ""]
32455 #[doc = "ID: 54"]
32456 SAFETY_SET_ALLOWED_AREA(SAFETY_SET_ALLOWED_AREA_DATA),
32457 #[doc = "The RAW IMU readings for the usual 9DOF sensor setup. This message should contain the scaled values to the described units."]
32458 #[doc = ""]
32459 #[doc = "ID: 26"]
32460 SCALED_IMU(SCALED_IMU_DATA),
32461 #[doc = "The RAW IMU readings for secondary 9DOF sensor setup. This message should contain the scaled values to the described units."]
32462 #[doc = ""]
32463 #[doc = "ID: 116"]
32464 SCALED_IMU2(SCALED_IMU2_DATA),
32465 #[doc = "The RAW IMU readings for 3rd 9DOF sensor setup. This message should contain the scaled values to the described units."]
32466 #[doc = ""]
32467 #[doc = "ID: 129"]
32468 SCALED_IMU3(SCALED_IMU3_DATA),
32469 #[doc = "The pressure readings for the typical setup of one absolute and differential pressure sensor. The units are as specified in each field."]
32470 #[doc = ""]
32471 #[doc = "ID: 29"]
32472 SCALED_PRESSURE(SCALED_PRESSURE_DATA),
32473 #[doc = "Barometer readings for 2nd barometer."]
32474 #[doc = ""]
32475 #[doc = "ID: 137"]
32476 SCALED_PRESSURE2(SCALED_PRESSURE2_DATA),
32477 #[doc = "Barometer readings for 3rd barometer."]
32478 #[doc = ""]
32479 #[doc = "ID: 143"]
32480 SCALED_PRESSURE3(SCALED_PRESSURE3_DATA),
32481 #[doc = "Control a serial port. This can be used for raw access to an onboard serial peripheral such as a GPS or telemetry radio. It is designed to make it possible to update the devices firmware via MAVLink messages or change the devices settings. A message with zero bytes can be used to change just the baudrate."]
32482 #[doc = ""]
32483 #[doc = "ID: 126"]
32484 SERIAL_CONTROL(SERIAL_CONTROL_DATA),
32485 #[doc = "Superseded by ACTUATOR_OUTPUT_STATUS. The RAW values of the servo outputs (for RC input from the remote, use the RC_CHANNELS messages). The standard PPM modulation is as follows: 1000 microseconds: 0%, 2000 microseconds: 100%."]
32486 #[doc = ""]
32487 #[doc = "ID: 36"]
32488 SERVO_OUTPUT_RAW(SERVO_OUTPUT_RAW_DATA),
32489 #[doc = "Setup a MAVLink2 signing key. If called with secret_key of all zero and zero initial_timestamp will disable signing."]
32490 #[doc = ""]
32491 #[doc = "ID: 256"]
32492 SETUP_SIGNING(SETUP_SIGNING_DATA),
32493 #[doc = "Set the vehicle attitude and body angular rates."]
32494 #[doc = ""]
32495 #[doc = "ID: 139"]
32496 SET_ACTUATOR_CONTROL_TARGET(SET_ACTUATOR_CONTROL_TARGET_DATA),
32497 #[doc = "Sets a desired vehicle attitude. Used by an external controller to command the vehicle (manual controller or other system)."]
32498 #[doc = ""]
32499 #[doc = "ID: 82"]
32500 SET_ATTITUDE_TARGET(SET_ATTITUDE_TARGET_DATA),
32501 #[doc = "Sets the GPS coordinates of the vehicle local origin (0,0,0) position. Vehicle should emit GPS_GLOBAL_ORIGIN irrespective of whether the origin is changed. This enables transform between the local coordinate frame and the global (GPS) coordinate frame, which may be necessary when (for example) indoor and outdoor settings are connected and the MAV should move from in- to outdoor."]
32502 #[doc = ""]
32503 #[doc = "ID: 48"]
32504 #[deprecated = " See `MAV_CMD_SET_GLOBAL_ORIGIN` (Deprecated since 2025-04)"]
32505 SET_GPS_GLOBAL_ORIGIN(SET_GPS_GLOBAL_ORIGIN_DATA),
32506 #[doc = "Sets the home position. \tThe home position is the default position that the system will return to and land on. The position is set automatically by the system during the takeoff (and may also be set using this message). The global and local positions encode the position in the respective coordinate frames, while the q parameter encodes the orientation of the surface. Under normal conditions it describes the heading and terrain slope, which can be used by the aircraft to adjust the approach. The approach 3D vector describes the point to which the system should fly in normal flight mode and then perform a landing sequence along the vector. Note: the current home position may be emitted in a HOME_POSITION message on request (using MAV_CMD_REQUEST_MESSAGE with param1=242)."]
32507 #[doc = ""]
32508 #[doc = "ID: 243"]
32509 #[deprecated = "The command protocol version (MAV_CMD_DO_SET_HOME) allows a GCS to detect when setting the home position has failed. See `MAV_CMD_DO_SET_HOME` (Deprecated since 2022-02)"]
32510 SET_HOME_POSITION(SET_HOME_POSITION_DATA),
32511 #[doc = "Set the system mode, as defined by enum MAV_MODE. There is no target component id as the mode is by definition for the overall aircraft, not only for one component."]
32512 #[doc = ""]
32513 #[doc = "ID: 11"]
32514 #[deprecated = "Use COMMAND_LONG with MAV_CMD_DO_SET_MODE instead. See `MAV_CMD_DO_SET_MODE` (Deprecated since 2015-12)"]
32515 SET_MODE(SET_MODE_DATA),
32516 #[doc = "Sets a desired vehicle position, velocity, and/or acceleration in a global coordinate system (WGS84). Used by an external controller to command the vehicle (manual controller or other system)."]
32517 #[doc = ""]
32518 #[doc = "ID: 86"]
32519 SET_POSITION_TARGET_GLOBAL_INT(SET_POSITION_TARGET_GLOBAL_INT_DATA),
32520 #[doc = "Sets a desired vehicle position in a local north-east-down coordinate frame. Used by an external controller to command the vehicle (manual controller or other system)."]
32521 #[doc = ""]
32522 #[doc = "ID: 84"]
32523 SET_POSITION_TARGET_LOCAL_NED(SET_POSITION_TARGET_LOCAL_NED_DATA),
32524 #[doc = "Status of simulation environment, if used."]
32525 #[doc = ""]
32526 #[doc = "ID: 108"]
32527 SIM_STATE(SIM_STATE_DATA),
32528 #[doc = "Smart Battery information (static/infrequent update). Use for updates from: smart battery to flight stack, flight stack to GCS. Use BATTERY_STATUS for the frequent battery updates."]
32529 #[doc = ""]
32530 #[doc = "ID: 370"]
32531 #[deprecated = "The BATTERY_INFO message is better aligned with UAVCAN messages, and in any case is useful even if a battery is not \"smart\". See `BATTERY_INFO` (Deprecated since 2024-02)"]
32532 SMART_BATTERY_INFO(SMART_BATTERY_INFO_DATA),
32533 #[doc = "Status text message. These messages are printed in yellow in the COMM console of QGroundControl. WARNING: They consume quite some bandwidth, so use only for important status and error messages. If implemented wisely, these messages are buffered on the MCU and sent only at a limited rate (e.g. 10 Hz)."]
32534 #[doc = ""]
32535 #[doc = "ID: 253"]
32536 STATUSTEXT(STATUSTEXT_DATA),
32537 #[doc = "Information about a storage medium. This message is sent in response to a request with MAV_CMD_REQUEST_MESSAGE and whenever the status of the storage changes (STORAGE_STATUS). Use MAV_CMD_REQUEST_MESSAGE.param2 to indicate the index/id of requested storage: 0 for all, 1 for first, 2 for second, etc."]
32538 #[doc = ""]
32539 #[doc = "ID: 261"]
32540 STORAGE_INFORMATION(STORAGE_INFORMATION_DATA),
32541 #[doc = "Tune formats supported by vehicle. This should be emitted as response to MAV_CMD_REQUEST_MESSAGE."]
32542 #[doc = ""]
32543 #[doc = "ID: 401"]
32544 SUPPORTED_TUNES(SUPPORTED_TUNES_DATA),
32545 #[doc = "The system time is the time of the master clock. This can be emitted by flight controllers, onboard computers, or other components in the MAVLink network. Components that are using a less reliable time source, such as a battery-backed real time clock, can choose to match their system clock to that of a SYSTEM_TYPE that indicates a more recent time. This allows more broadly accurate date stamping of logs, and so on. If precise time synchronization is needed then use TIMESYNC instead."]
32546 #[doc = ""]
32547 #[doc = "ID: 2"]
32548 SYSTEM_TIME(SYSTEM_TIME_DATA),
32549 #[doc = "The general system state. If the system is following the MAVLink standard, the system state is mainly defined by three orthogonal states/modes: The system mode, which is either LOCKED (motors shut down and locked), MANUAL (system under RC control), GUIDED (system with autonomous position control, position setpoint controlled manually) or AUTO (system guided by path/waypoint planner). The NAV_MODE defined the current flight state: LIFTOFF (often an open-loop maneuver), LANDING, WAYPOINTS or VECTOR. This represents the internal navigation state machine. The system status shows whether the system is currently active or not and if an emergency occurred. During the CRITICAL and EMERGENCY states the MAV is still considered to be active, but should start emergency procedures autonomously. After a failure occurred it should first move from active to critical to allow manual intervention and then move to emergency after a certain timeout."]
32550 #[doc = ""]
32551 #[doc = "ID: 1"]
32552 SYS_STATUS(SYS_STATUS_DATA),
32553 #[doc = "Request that the vehicle report terrain height at the given location (expected response is a TERRAIN_REPORT). Used by GCS to check if vehicle has all terrain data needed for a mission."]
32554 #[doc = ""]
32555 #[doc = "ID: 135"]
32556 TERRAIN_CHECK(TERRAIN_CHECK_DATA),
32557 #[doc = "Terrain data sent from GCS. The lat/lon and grid_spacing must be the same as a lat/lon from a TERRAIN_REQUEST. See terrain protocol docs: <https://mavlink.io/en/services/terrain.html>."]
32558 #[doc = ""]
32559 #[doc = "ID: 134"]
32560 TERRAIN_DATA(TERRAIN_DATA_DATA),
32561 #[doc = "Streamed from drone to report progress of terrain map download (initiated by TERRAIN_REQUEST), or sent as a response to a TERRAIN_CHECK request. See terrain protocol docs: <https://mavlink.io/en/services/terrain.html>."]
32562 #[doc = ""]
32563 #[doc = "ID: 136"]
32564 TERRAIN_REPORT(TERRAIN_REPORT_DATA),
32565 #[doc = "Request for terrain data and terrain status. See terrain protocol docs: <https://mavlink.io/en/services/terrain.html>."]
32566 #[doc = ""]
32567 #[doc = "ID: 133"]
32568 TERRAIN_REQUEST(TERRAIN_REQUEST_DATA),
32569 #[doc = "Time synchronization message. The message is used for both timesync requests and responses. The request is sent with `ts1=syncing component timestamp` and `tc1=0`, and may be broadcast or targeted to a specific system/component. The response is sent with `ts1=syncing component timestamp` (mirror back unchanged), and `tc1=responding component timestamp`, with the `target_system` and `target_component` set to ids of the original request. Systems can determine if they are receiving a request or response based on the value of `tc`. If the response has `target_system==target_component==0` the remote system has not been updated to use the component IDs and cannot reliably timesync; the requestor may report an error. Timestamps are UNIX Epoch time or time since system boot in nanoseconds (the timestamp format can be inferred by checking for the magnitude of the number; generally it doesn't matter as only the offset is used). The message sequence is repeated numerous times with results being filtered/averaged to estimate the offset. See also: <https://mavlink.io/en/services/timesync.html>."]
32570 #[doc = ""]
32571 #[doc = "ID: 111"]
32572 TIMESYNC(TIMESYNC_DATA),
32573 #[doc = "Time/duration estimates for various events and actions given the current vehicle state and position."]
32574 #[doc = ""]
32575 #[doc = "ID: 380"]
32576 TIME_ESTIMATE_TO_TARGET(TIME_ESTIMATE_TO_TARGET_DATA),
32577 #[doc = "Describe a trajectory using an array of up-to 5 bezier control points in the local frame (MAV_FRAME_LOCAL_NED)."]
32578 #[doc = ""]
32579 #[doc = "ID: 333"]
32580 TRAJECTORY_REPRESENTATION_BEZIER(TRAJECTORY_REPRESENTATION_BEZIER_DATA),
32581 #[doc = "Describe a trajectory using an array of up-to 5 waypoints in the local frame (MAV_FRAME_LOCAL_NED)."]
32582 #[doc = ""]
32583 #[doc = "ID: 332"]
32584 TRAJECTORY_REPRESENTATION_WAYPOINTS(TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA),
32585 #[doc = "Message for transporting \"arbitrary\" variable-length data from one component to another (broadcast is not forbidden, but discouraged). The encoding of the data is usually extension specific, i.e. determined by the source, and is usually not documented as part of the MAVLink specification."]
32586 #[doc = ""]
32587 #[doc = "ID: 385"]
32588 TUNNEL(TUNNEL_DATA),
32589 #[doc = "General information describing a particular UAVCAN node. Please refer to the definition of the UAVCAN service \"uavcan.protocol.GetNodeInfo\" for the background information. This message should be emitted by the system whenever a new node appears online, or an existing node reboots. Additionally, it can be emitted upon request from the other end of the MAVLink channel (see MAV_CMD_UAVCAN_GET_NODE_INFO). It is also not prohibited to emit this message unconditionally at a low frequency. The UAVCAN specification is available at <http://uavcan.org>."]
32590 #[doc = ""]
32591 #[doc = "ID: 311"]
32592 UAVCAN_NODE_INFO(UAVCAN_NODE_INFO_DATA),
32593 #[doc = "General status information of an UAVCAN node. Please refer to the definition of the UAVCAN message \"uavcan.protocol.NodeStatus\" for the background information. The UAVCAN specification is available at <http://uavcan.org>."]
32594 #[doc = ""]
32595 #[doc = "ID: 310"]
32596 UAVCAN_NODE_STATUS(UAVCAN_NODE_STATUS_DATA),
32597 #[doc = "The global position resulting from GPS and sensor fusion."]
32598 #[doc = ""]
32599 #[doc = "ID: 340"]
32600 UTM_GLOBAL_POSITION(UTM_GLOBAL_POSITION_DATA),
32601 #[doc = "Message implementing parts of the V2 payload specs in V1 frames for transitional support."]
32602 #[doc = ""]
32603 #[doc = "ID: 248"]
32604 V2_EXTENSION(V2_EXTENSION_DATA),
32605 #[doc = "Metrics typically displayed on a HUD for fixed wing aircraft."]
32606 #[doc = ""]
32607 #[doc = "ID: 74"]
32608 VFR_HUD(VFR_HUD_DATA),
32609 #[doc = "Vibration levels and accelerometer clipping."]
32610 #[doc = ""]
32611 #[doc = "ID: 241"]
32612 VIBRATION(VIBRATION_DATA),
32613 #[doc = "Global position estimate from a Vicon motion system source."]
32614 #[doc = ""]
32615 #[doc = "ID: 104"]
32616 VICON_POSITION_ESTIMATE(VICON_POSITION_ESTIMATE_DATA),
32617 #[doc = "Information about video stream. It may be requested using MAV_CMD_REQUEST_MESSAGE, where param2 indicates the video stream id: 0 for all streams, 1 for first, 2 for second, etc."]
32618 #[doc = ""]
32619 #[doc = "ID: 269"]
32620 VIDEO_STREAM_INFORMATION(VIDEO_STREAM_INFORMATION_DATA),
32621 #[doc = "Information about the status of a video stream. It may be requested using MAV_CMD_REQUEST_MESSAGE."]
32622 #[doc = ""]
32623 #[doc = "ID: 270"]
32624 VIDEO_STREAM_STATUS(VIDEO_STREAM_STATUS_DATA),
32625 #[doc = "Local position/attitude estimate from a vision source."]
32626 #[doc = ""]
32627 #[doc = "ID: 102"]
32628 VISION_POSITION_ESTIMATE(VISION_POSITION_ESTIMATE_DATA),
32629 #[doc = "Speed estimate from a vision source."]
32630 #[doc = ""]
32631 #[doc = "ID: 103"]
32632 VISION_SPEED_ESTIMATE(VISION_SPEED_ESTIMATE_DATA),
32633 #[doc = "Cumulative distance traveled for each reported wheel."]
32634 #[doc = ""]
32635 #[doc = "ID: 9000"]
32636 WHEEL_DISTANCE(WHEEL_DISTANCE_DATA),
32637 #[doc = "Configure WiFi AP SSID, password, and mode. This message is re-emitted as an acknowledgement by the AP. The message may also be explicitly requested using MAV_CMD_REQUEST_MESSAGE."]
32638 #[doc = ""]
32639 #[doc = "ID: 299"]
32640 WIFI_CONFIG_AP(WIFI_CONFIG_AP_DATA),
32641 #[doc = "Winch status."]
32642 #[doc = ""]
32643 #[doc = "ID: 9005"]
32644 WINCH_STATUS(WINCH_STATUS_DATA),
32645 #[doc = "Wind estimate from vehicle. Note that despite the name, this message does not actually contain any covariances but instead variability and accuracy fields in terms of standard deviation (1-STD)."]
32646 #[doc = ""]
32647 #[doc = "ID: 231"]
32648 WIND_COV(WIND_COV_DATA),
32649}
32650impl MavMessage {
32651 pub const fn all_ids() -> &'static [u32] {
32652 &[
32653 0u32, 1u32, 2u32, 4u32, 5u32, 6u32, 7u32, 8u32, 11u32, 20u32, 21u32, 22u32, 23u32,
32654 24u32, 25u32, 26u32, 27u32, 28u32, 29u32, 30u32, 31u32, 32u32, 33u32, 34u32, 35u32,
32655 36u32, 37u32, 38u32, 39u32, 40u32, 41u32, 42u32, 43u32, 44u32, 45u32, 46u32, 47u32,
32656 48u32, 49u32, 50u32, 51u32, 54u32, 55u32, 61u32, 62u32, 63u32, 64u32, 65u32, 66u32,
32657 67u32, 69u32, 70u32, 73u32, 74u32, 75u32, 76u32, 77u32, 80u32, 81u32, 82u32, 83u32,
32658 84u32, 85u32, 86u32, 87u32, 89u32, 90u32, 91u32, 92u32, 93u32, 100u32, 101u32, 102u32,
32659 103u32, 104u32, 105u32, 106u32, 107u32, 108u32, 109u32, 110u32, 111u32, 112u32, 113u32,
32660 114u32, 115u32, 116u32, 117u32, 118u32, 119u32, 120u32, 121u32, 122u32, 123u32, 124u32,
32661 125u32, 126u32, 127u32, 128u32, 129u32, 130u32, 131u32, 132u32, 133u32, 134u32, 135u32,
32662 136u32, 137u32, 138u32, 139u32, 140u32, 141u32, 142u32, 143u32, 144u32, 146u32, 147u32,
32663 148u32, 149u32, 162u32, 192u32, 225u32, 230u32, 231u32, 232u32, 233u32, 234u32, 235u32,
32664 241u32, 242u32, 243u32, 244u32, 245u32, 246u32, 247u32, 248u32, 249u32, 250u32, 251u32,
32665 252u32, 253u32, 254u32, 256u32, 257u32, 258u32, 259u32, 260u32, 261u32, 262u32, 263u32,
32666 264u32, 265u32, 266u32, 267u32, 268u32, 269u32, 270u32, 271u32, 275u32, 276u32, 277u32,
32667 280u32, 281u32, 282u32, 283u32, 284u32, 285u32, 286u32, 287u32, 288u32, 290u32, 291u32,
32668 299u32, 300u32, 301u32, 310u32, 311u32, 320u32, 321u32, 322u32, 323u32, 324u32, 330u32,
32669 331u32, 332u32, 333u32, 334u32, 335u32, 336u32, 339u32, 340u32, 350u32, 360u32, 370u32,
32670 371u32, 372u32, 373u32, 375u32, 380u32, 385u32, 386u32, 387u32, 388u32, 390u32, 395u32,
32671 396u32, 397u32, 400u32, 401u32, 410u32, 411u32, 412u32, 413u32, 435u32, 436u32, 437u32,
32672 440u32, 9000u32, 9005u32, 12900u32, 12901u32, 12902u32, 12903u32, 12904u32, 12905u32,
32673 12915u32, 12918u32, 12919u32, 12920u32, 60050u32, 60051u32, 60052u32, 60053u32,
32674 ]
32675 }
32676}
32677impl Message for MavMessage {
32678 fn parse(
32679 version: MavlinkVersion,
32680 id: u32,
32681 payload: &[u8],
32682 ) -> Result<Self, ::mavlink_core::error::ParserError> {
32683 match id {
32684 ACTUATOR_CONTROL_TARGET_DATA::ID => {
32685 ACTUATOR_CONTROL_TARGET_DATA::deser(version, payload)
32686 .map(Self::ACTUATOR_CONTROL_TARGET)
32687 }
32688 ACTUATOR_OUTPUT_STATUS_DATA::ID => ACTUATOR_OUTPUT_STATUS_DATA::deser(version, payload)
32689 .map(Self::ACTUATOR_OUTPUT_STATUS),
32690 ADSB_VEHICLE_DATA::ID => {
32691 ADSB_VEHICLE_DATA::deser(version, payload).map(Self::ADSB_VEHICLE)
32692 }
32693 AIS_VESSEL_DATA::ID => AIS_VESSEL_DATA::deser(version, payload).map(Self::AIS_VESSEL),
32694 ALTITUDE_DATA::ID => ALTITUDE_DATA::deser(version, payload).map(Self::ALTITUDE),
32695 ATTITUDE_DATA::ID => ATTITUDE_DATA::deser(version, payload).map(Self::ATTITUDE),
32696 ATTITUDE_QUATERNION_DATA::ID => {
32697 ATTITUDE_QUATERNION_DATA::deser(version, payload).map(Self::ATTITUDE_QUATERNION)
32698 }
32699 ATTITUDE_QUATERNION_COV_DATA::ID => {
32700 ATTITUDE_QUATERNION_COV_DATA::deser(version, payload)
32701 .map(Self::ATTITUDE_QUATERNION_COV)
32702 }
32703 ATTITUDE_TARGET_DATA::ID => {
32704 ATTITUDE_TARGET_DATA::deser(version, payload).map(Self::ATTITUDE_TARGET)
32705 }
32706 ATT_POS_MOCAP_DATA::ID => {
32707 ATT_POS_MOCAP_DATA::deser(version, payload).map(Self::ATT_POS_MOCAP)
32708 }
32709 AUTH_KEY_DATA::ID => AUTH_KEY_DATA::deser(version, payload).map(Self::AUTH_KEY),
32710 AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA::ID => {
32711 AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA::deser(version, payload)
32712 .map(Self::AUTOPILOT_STATE_FOR_GIMBAL_DEVICE)
32713 }
32714 AUTOPILOT_VERSION_DATA::ID => {
32715 AUTOPILOT_VERSION_DATA::deser(version, payload).map(Self::AUTOPILOT_VERSION)
32716 }
32717 AVAILABLE_MODES_DATA::ID => {
32718 AVAILABLE_MODES_DATA::deser(version, payload).map(Self::AVAILABLE_MODES)
32719 }
32720 AVAILABLE_MODES_MONITOR_DATA::ID => {
32721 AVAILABLE_MODES_MONITOR_DATA::deser(version, payload)
32722 .map(Self::AVAILABLE_MODES_MONITOR)
32723 }
32724 AVSS_DRONE_IMU_DATA::ID => {
32725 AVSS_DRONE_IMU_DATA::deser(version, payload).map(Self::AVSS_DRONE_IMU)
32726 }
32727 AVSS_DRONE_OPERATION_MODE_DATA::ID => {
32728 AVSS_DRONE_OPERATION_MODE_DATA::deser(version, payload)
32729 .map(Self::AVSS_DRONE_OPERATION_MODE)
32730 }
32731 AVSS_DRONE_POSITION_DATA::ID => {
32732 AVSS_DRONE_POSITION_DATA::deser(version, payload).map(Self::AVSS_DRONE_POSITION)
32733 }
32734 AVSS_PRS_SYS_STATUS_DATA::ID => {
32735 AVSS_PRS_SYS_STATUS_DATA::deser(version, payload).map(Self::AVSS_PRS_SYS_STATUS)
32736 }
32737 BATTERY_INFO_DATA::ID => {
32738 BATTERY_INFO_DATA::deser(version, payload).map(Self::BATTERY_INFO)
32739 }
32740 BATTERY_STATUS_DATA::ID => {
32741 BATTERY_STATUS_DATA::deser(version, payload).map(Self::BATTERY_STATUS)
32742 }
32743 BUTTON_CHANGE_DATA::ID => {
32744 BUTTON_CHANGE_DATA::deser(version, payload).map(Self::BUTTON_CHANGE)
32745 }
32746 CAMERA_CAPTURE_STATUS_DATA::ID => {
32747 CAMERA_CAPTURE_STATUS_DATA::deser(version, payload).map(Self::CAMERA_CAPTURE_STATUS)
32748 }
32749 CAMERA_FOV_STATUS_DATA::ID => {
32750 CAMERA_FOV_STATUS_DATA::deser(version, payload).map(Self::CAMERA_FOV_STATUS)
32751 }
32752 CAMERA_IMAGE_CAPTURED_DATA::ID => {
32753 CAMERA_IMAGE_CAPTURED_DATA::deser(version, payload).map(Self::CAMERA_IMAGE_CAPTURED)
32754 }
32755 CAMERA_INFORMATION_DATA::ID => {
32756 CAMERA_INFORMATION_DATA::deser(version, payload).map(Self::CAMERA_INFORMATION)
32757 }
32758 CAMERA_SETTINGS_DATA::ID => {
32759 CAMERA_SETTINGS_DATA::deser(version, payload).map(Self::CAMERA_SETTINGS)
32760 }
32761 CAMERA_THERMAL_RANGE_DATA::ID => {
32762 CAMERA_THERMAL_RANGE_DATA::deser(version, payload).map(Self::CAMERA_THERMAL_RANGE)
32763 }
32764 CAMERA_TRACKING_GEO_STATUS_DATA::ID => {
32765 CAMERA_TRACKING_GEO_STATUS_DATA::deser(version, payload)
32766 .map(Self::CAMERA_TRACKING_GEO_STATUS)
32767 }
32768 CAMERA_TRACKING_IMAGE_STATUS_DATA::ID => {
32769 CAMERA_TRACKING_IMAGE_STATUS_DATA::deser(version, payload)
32770 .map(Self::CAMERA_TRACKING_IMAGE_STATUS)
32771 }
32772 CAMERA_TRIGGER_DATA::ID => {
32773 CAMERA_TRIGGER_DATA::deser(version, payload).map(Self::CAMERA_TRIGGER)
32774 }
32775 CANFD_FRAME_DATA::ID => {
32776 CANFD_FRAME_DATA::deser(version, payload).map(Self::CANFD_FRAME)
32777 }
32778 CAN_FILTER_MODIFY_DATA::ID => {
32779 CAN_FILTER_MODIFY_DATA::deser(version, payload).map(Self::CAN_FILTER_MODIFY)
32780 }
32781 CAN_FRAME_DATA::ID => CAN_FRAME_DATA::deser(version, payload).map(Self::CAN_FRAME),
32782 CELLULAR_CONFIG_DATA::ID => {
32783 CELLULAR_CONFIG_DATA::deser(version, payload).map(Self::CELLULAR_CONFIG)
32784 }
32785 CELLULAR_STATUS_DATA::ID => {
32786 CELLULAR_STATUS_DATA::deser(version, payload).map(Self::CELLULAR_STATUS)
32787 }
32788 CHANGE_OPERATOR_CONTROL_DATA::ID => {
32789 CHANGE_OPERATOR_CONTROL_DATA::deser(version, payload)
32790 .map(Self::CHANGE_OPERATOR_CONTROL)
32791 }
32792 CHANGE_OPERATOR_CONTROL_ACK_DATA::ID => {
32793 CHANGE_OPERATOR_CONTROL_ACK_DATA::deser(version, payload)
32794 .map(Self::CHANGE_OPERATOR_CONTROL_ACK)
32795 }
32796 COLLISION_DATA::ID => COLLISION_DATA::deser(version, payload).map(Self::COLLISION),
32797 COMMAND_ACK_DATA::ID => {
32798 COMMAND_ACK_DATA::deser(version, payload).map(Self::COMMAND_ACK)
32799 }
32800 COMMAND_CANCEL_DATA::ID => {
32801 COMMAND_CANCEL_DATA::deser(version, payload).map(Self::COMMAND_CANCEL)
32802 }
32803 COMMAND_INT_DATA::ID => {
32804 COMMAND_INT_DATA::deser(version, payload).map(Self::COMMAND_INT)
32805 }
32806 COMMAND_LONG_DATA::ID => {
32807 COMMAND_LONG_DATA::deser(version, payload).map(Self::COMMAND_LONG)
32808 }
32809 COMPONENT_INFORMATION_DATA::ID => {
32810 COMPONENT_INFORMATION_DATA::deser(version, payload).map(Self::COMPONENT_INFORMATION)
32811 }
32812 COMPONENT_INFORMATION_BASIC_DATA::ID => {
32813 COMPONENT_INFORMATION_BASIC_DATA::deser(version, payload)
32814 .map(Self::COMPONENT_INFORMATION_BASIC)
32815 }
32816 COMPONENT_METADATA_DATA::ID => {
32817 COMPONENT_METADATA_DATA::deser(version, payload).map(Self::COMPONENT_METADATA)
32818 }
32819 CONTROL_SYSTEM_STATE_DATA::ID => {
32820 CONTROL_SYSTEM_STATE_DATA::deser(version, payload).map(Self::CONTROL_SYSTEM_STATE)
32821 }
32822 CURRENT_EVENT_SEQUENCE_DATA::ID => CURRENT_EVENT_SEQUENCE_DATA::deser(version, payload)
32823 .map(Self::CURRENT_EVENT_SEQUENCE),
32824 CURRENT_MODE_DATA::ID => {
32825 CURRENT_MODE_DATA::deser(version, payload).map(Self::CURRENT_MODE)
32826 }
32827 DATA_STREAM_DATA::ID => {
32828 DATA_STREAM_DATA::deser(version, payload).map(Self::DATA_STREAM)
32829 }
32830 DATA_TRANSMISSION_HANDSHAKE_DATA::ID => {
32831 DATA_TRANSMISSION_HANDSHAKE_DATA::deser(version, payload)
32832 .map(Self::DATA_TRANSMISSION_HANDSHAKE)
32833 }
32834 DEBUG_DATA::ID => DEBUG_DATA::deser(version, payload).map(Self::DEBUG),
32835 DEBUG_FLOAT_ARRAY_DATA::ID => {
32836 DEBUG_FLOAT_ARRAY_DATA::deser(version, payload).map(Self::DEBUG_FLOAT_ARRAY)
32837 }
32838 DEBUG_VECT_DATA::ID => DEBUG_VECT_DATA::deser(version, payload).map(Self::DEBUG_VECT),
32839 DISTANCE_SENSOR_DATA::ID => {
32840 DISTANCE_SENSOR_DATA::deser(version, payload).map(Self::DISTANCE_SENSOR)
32841 }
32842 EFI_STATUS_DATA::ID => EFI_STATUS_DATA::deser(version, payload).map(Self::EFI_STATUS),
32843 ENCAPSULATED_DATA_DATA::ID => {
32844 ENCAPSULATED_DATA_DATA::deser(version, payload).map(Self::ENCAPSULATED_DATA)
32845 }
32846 ESC_INFO_DATA::ID => ESC_INFO_DATA::deser(version, payload).map(Self::ESC_INFO),
32847 ESC_STATUS_DATA::ID => ESC_STATUS_DATA::deser(version, payload).map(Self::ESC_STATUS),
32848 ESTIMATOR_STATUS_DATA::ID => {
32849 ESTIMATOR_STATUS_DATA::deser(version, payload).map(Self::ESTIMATOR_STATUS)
32850 }
32851 EVENT_DATA::ID => EVENT_DATA::deser(version, payload).map(Self::EVENT),
32852 EXTENDED_SYS_STATE_DATA::ID => {
32853 EXTENDED_SYS_STATE_DATA::deser(version, payload).map(Self::EXTENDED_SYS_STATE)
32854 }
32855 FENCE_STATUS_DATA::ID => {
32856 FENCE_STATUS_DATA::deser(version, payload).map(Self::FENCE_STATUS)
32857 }
32858 FILE_TRANSFER_PROTOCOL_DATA::ID => FILE_TRANSFER_PROTOCOL_DATA::deser(version, payload)
32859 .map(Self::FILE_TRANSFER_PROTOCOL),
32860 FLIGHT_INFORMATION_DATA::ID => {
32861 FLIGHT_INFORMATION_DATA::deser(version, payload).map(Self::FLIGHT_INFORMATION)
32862 }
32863 FOLLOW_TARGET_DATA::ID => {
32864 FOLLOW_TARGET_DATA::deser(version, payload).map(Self::FOLLOW_TARGET)
32865 }
32866 FUEL_STATUS_DATA::ID => {
32867 FUEL_STATUS_DATA::deser(version, payload).map(Self::FUEL_STATUS)
32868 }
32869 GENERATOR_STATUS_DATA::ID => {
32870 GENERATOR_STATUS_DATA::deser(version, payload).map(Self::GENERATOR_STATUS)
32871 }
32872 GIMBAL_DEVICE_ATTITUDE_STATUS_DATA::ID => {
32873 GIMBAL_DEVICE_ATTITUDE_STATUS_DATA::deser(version, payload)
32874 .map(Self::GIMBAL_DEVICE_ATTITUDE_STATUS)
32875 }
32876 GIMBAL_DEVICE_INFORMATION_DATA::ID => {
32877 GIMBAL_DEVICE_INFORMATION_DATA::deser(version, payload)
32878 .map(Self::GIMBAL_DEVICE_INFORMATION)
32879 }
32880 GIMBAL_DEVICE_SET_ATTITUDE_DATA::ID => {
32881 GIMBAL_DEVICE_SET_ATTITUDE_DATA::deser(version, payload)
32882 .map(Self::GIMBAL_DEVICE_SET_ATTITUDE)
32883 }
32884 GIMBAL_MANAGER_INFORMATION_DATA::ID => {
32885 GIMBAL_MANAGER_INFORMATION_DATA::deser(version, payload)
32886 .map(Self::GIMBAL_MANAGER_INFORMATION)
32887 }
32888 GIMBAL_MANAGER_SET_ATTITUDE_DATA::ID => {
32889 GIMBAL_MANAGER_SET_ATTITUDE_DATA::deser(version, payload)
32890 .map(Self::GIMBAL_MANAGER_SET_ATTITUDE)
32891 }
32892 GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA::ID => {
32893 GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA::deser(version, payload)
32894 .map(Self::GIMBAL_MANAGER_SET_MANUAL_CONTROL)
32895 }
32896 GIMBAL_MANAGER_SET_PITCHYAW_DATA::ID => {
32897 GIMBAL_MANAGER_SET_PITCHYAW_DATA::deser(version, payload)
32898 .map(Self::GIMBAL_MANAGER_SET_PITCHYAW)
32899 }
32900 GIMBAL_MANAGER_STATUS_DATA::ID => {
32901 GIMBAL_MANAGER_STATUS_DATA::deser(version, payload).map(Self::GIMBAL_MANAGER_STATUS)
32902 }
32903 GLOBAL_POSITION_INT_DATA::ID => {
32904 GLOBAL_POSITION_INT_DATA::deser(version, payload).map(Self::GLOBAL_POSITION_INT)
32905 }
32906 GLOBAL_POSITION_INT_COV_DATA::ID => {
32907 GLOBAL_POSITION_INT_COV_DATA::deser(version, payload)
32908 .map(Self::GLOBAL_POSITION_INT_COV)
32909 }
32910 GLOBAL_VISION_POSITION_ESTIMATE_DATA::ID => {
32911 GLOBAL_VISION_POSITION_ESTIMATE_DATA::deser(version, payload)
32912 .map(Self::GLOBAL_VISION_POSITION_ESTIMATE)
32913 }
32914 GPS2_RAW_DATA::ID => GPS2_RAW_DATA::deser(version, payload).map(Self::GPS2_RAW),
32915 GPS2_RTK_DATA::ID => GPS2_RTK_DATA::deser(version, payload).map(Self::GPS2_RTK),
32916 GPS_GLOBAL_ORIGIN_DATA::ID => {
32917 GPS_GLOBAL_ORIGIN_DATA::deser(version, payload).map(Self::GPS_GLOBAL_ORIGIN)
32918 }
32919 GPS_INJECT_DATA_DATA::ID => {
32920 GPS_INJECT_DATA_DATA::deser(version, payload).map(Self::GPS_INJECT_DATA)
32921 }
32922 GPS_INPUT_DATA::ID => GPS_INPUT_DATA::deser(version, payload).map(Self::GPS_INPUT),
32923 GPS_RAW_INT_DATA::ID => {
32924 GPS_RAW_INT_DATA::deser(version, payload).map(Self::GPS_RAW_INT)
32925 }
32926 GPS_RTCM_DATA_DATA::ID => {
32927 GPS_RTCM_DATA_DATA::deser(version, payload).map(Self::GPS_RTCM_DATA)
32928 }
32929 GPS_RTK_DATA::ID => GPS_RTK_DATA::deser(version, payload).map(Self::GPS_RTK),
32930 GPS_STATUS_DATA::ID => GPS_STATUS_DATA::deser(version, payload).map(Self::GPS_STATUS),
32931 HEARTBEAT_DATA::ID => HEARTBEAT_DATA::deser(version, payload).map(Self::HEARTBEAT),
32932 HIGHRES_IMU_DATA::ID => {
32933 HIGHRES_IMU_DATA::deser(version, payload).map(Self::HIGHRES_IMU)
32934 }
32935 HIGH_LATENCY_DATA::ID => {
32936 HIGH_LATENCY_DATA::deser(version, payload).map(Self::HIGH_LATENCY)
32937 }
32938 HIGH_LATENCY2_DATA::ID => {
32939 HIGH_LATENCY2_DATA::deser(version, payload).map(Self::HIGH_LATENCY2)
32940 }
32941 HIL_ACTUATOR_CONTROLS_DATA::ID => {
32942 HIL_ACTUATOR_CONTROLS_DATA::deser(version, payload).map(Self::HIL_ACTUATOR_CONTROLS)
32943 }
32944 HIL_CONTROLS_DATA::ID => {
32945 HIL_CONTROLS_DATA::deser(version, payload).map(Self::HIL_CONTROLS)
32946 }
32947 HIL_GPS_DATA::ID => HIL_GPS_DATA::deser(version, payload).map(Self::HIL_GPS),
32948 HIL_OPTICAL_FLOW_DATA::ID => {
32949 HIL_OPTICAL_FLOW_DATA::deser(version, payload).map(Self::HIL_OPTICAL_FLOW)
32950 }
32951 HIL_RC_INPUTS_RAW_DATA::ID => {
32952 HIL_RC_INPUTS_RAW_DATA::deser(version, payload).map(Self::HIL_RC_INPUTS_RAW)
32953 }
32954 HIL_SENSOR_DATA::ID => HIL_SENSOR_DATA::deser(version, payload).map(Self::HIL_SENSOR),
32955 HIL_STATE_DATA::ID => HIL_STATE_DATA::deser(version, payload).map(Self::HIL_STATE),
32956 HIL_STATE_QUATERNION_DATA::ID => {
32957 HIL_STATE_QUATERNION_DATA::deser(version, payload).map(Self::HIL_STATE_QUATERNION)
32958 }
32959 HOME_POSITION_DATA::ID => {
32960 HOME_POSITION_DATA::deser(version, payload).map(Self::HOME_POSITION)
32961 }
32962 HYGROMETER_SENSOR_DATA::ID => {
32963 HYGROMETER_SENSOR_DATA::deser(version, payload).map(Self::HYGROMETER_SENSOR)
32964 }
32965 ILLUMINATOR_STATUS_DATA::ID => {
32966 ILLUMINATOR_STATUS_DATA::deser(version, payload).map(Self::ILLUMINATOR_STATUS)
32967 }
32968 ISBD_LINK_STATUS_DATA::ID => {
32969 ISBD_LINK_STATUS_DATA::deser(version, payload).map(Self::ISBD_LINK_STATUS)
32970 }
32971 LANDING_TARGET_DATA::ID => {
32972 LANDING_TARGET_DATA::deser(version, payload).map(Self::LANDING_TARGET)
32973 }
32974 LINK_NODE_STATUS_DATA::ID => {
32975 LINK_NODE_STATUS_DATA::deser(version, payload).map(Self::LINK_NODE_STATUS)
32976 }
32977 LOCAL_POSITION_NED_DATA::ID => {
32978 LOCAL_POSITION_NED_DATA::deser(version, payload).map(Self::LOCAL_POSITION_NED)
32979 }
32980 LOCAL_POSITION_NED_COV_DATA::ID => LOCAL_POSITION_NED_COV_DATA::deser(version, payload)
32981 .map(Self::LOCAL_POSITION_NED_COV),
32982 LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA::ID => {
32983 LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA::deser(version, payload)
32984 .map(Self::LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET)
32985 }
32986 LOGGING_ACK_DATA::ID => {
32987 LOGGING_ACK_DATA::deser(version, payload).map(Self::LOGGING_ACK)
32988 }
32989 LOGGING_DATA_DATA::ID => {
32990 LOGGING_DATA_DATA::deser(version, payload).map(Self::LOGGING_DATA)
32991 }
32992 LOGGING_DATA_ACKED_DATA::ID => {
32993 LOGGING_DATA_ACKED_DATA::deser(version, payload).map(Self::LOGGING_DATA_ACKED)
32994 }
32995 LOG_DATA_DATA::ID => LOG_DATA_DATA::deser(version, payload).map(Self::LOG_DATA),
32996 LOG_ENTRY_DATA::ID => LOG_ENTRY_DATA::deser(version, payload).map(Self::LOG_ENTRY),
32997 LOG_ERASE_DATA::ID => LOG_ERASE_DATA::deser(version, payload).map(Self::LOG_ERASE),
32998 LOG_REQUEST_DATA_DATA::ID => {
32999 LOG_REQUEST_DATA_DATA::deser(version, payload).map(Self::LOG_REQUEST_DATA)
33000 }
33001 LOG_REQUEST_END_DATA::ID => {
33002 LOG_REQUEST_END_DATA::deser(version, payload).map(Self::LOG_REQUEST_END)
33003 }
33004 LOG_REQUEST_LIST_DATA::ID => {
33005 LOG_REQUEST_LIST_DATA::deser(version, payload).map(Self::LOG_REQUEST_LIST)
33006 }
33007 MAG_CAL_REPORT_DATA::ID => {
33008 MAG_CAL_REPORT_DATA::deser(version, payload).map(Self::MAG_CAL_REPORT)
33009 }
33010 MANUAL_CONTROL_DATA::ID => {
33011 MANUAL_CONTROL_DATA::deser(version, payload).map(Self::MANUAL_CONTROL)
33012 }
33013 MANUAL_SETPOINT_DATA::ID => {
33014 MANUAL_SETPOINT_DATA::deser(version, payload).map(Self::MANUAL_SETPOINT)
33015 }
33016 MEMORY_VECT_DATA::ID => {
33017 MEMORY_VECT_DATA::deser(version, payload).map(Self::MEMORY_VECT)
33018 }
33019 MESSAGE_INTERVAL_DATA::ID => {
33020 MESSAGE_INTERVAL_DATA::deser(version, payload).map(Self::MESSAGE_INTERVAL)
33021 }
33022 MISSION_ACK_DATA::ID => {
33023 MISSION_ACK_DATA::deser(version, payload).map(Self::MISSION_ACK)
33024 }
33025 MISSION_CLEAR_ALL_DATA::ID => {
33026 MISSION_CLEAR_ALL_DATA::deser(version, payload).map(Self::MISSION_CLEAR_ALL)
33027 }
33028 MISSION_COUNT_DATA::ID => {
33029 MISSION_COUNT_DATA::deser(version, payload).map(Self::MISSION_COUNT)
33030 }
33031 MISSION_CURRENT_DATA::ID => {
33032 MISSION_CURRENT_DATA::deser(version, payload).map(Self::MISSION_CURRENT)
33033 }
33034 MISSION_ITEM_DATA::ID => {
33035 MISSION_ITEM_DATA::deser(version, payload).map(Self::MISSION_ITEM)
33036 }
33037 MISSION_ITEM_INT_DATA::ID => {
33038 MISSION_ITEM_INT_DATA::deser(version, payload).map(Self::MISSION_ITEM_INT)
33039 }
33040 MISSION_ITEM_REACHED_DATA::ID => {
33041 MISSION_ITEM_REACHED_DATA::deser(version, payload).map(Self::MISSION_ITEM_REACHED)
33042 }
33043 MISSION_REQUEST_DATA::ID => {
33044 MISSION_REQUEST_DATA::deser(version, payload).map(Self::MISSION_REQUEST)
33045 }
33046 MISSION_REQUEST_INT_DATA::ID => {
33047 MISSION_REQUEST_INT_DATA::deser(version, payload).map(Self::MISSION_REQUEST_INT)
33048 }
33049 MISSION_REQUEST_LIST_DATA::ID => {
33050 MISSION_REQUEST_LIST_DATA::deser(version, payload).map(Self::MISSION_REQUEST_LIST)
33051 }
33052 MISSION_REQUEST_PARTIAL_LIST_DATA::ID => {
33053 MISSION_REQUEST_PARTIAL_LIST_DATA::deser(version, payload)
33054 .map(Self::MISSION_REQUEST_PARTIAL_LIST)
33055 }
33056 MISSION_SET_CURRENT_DATA::ID => {
33057 MISSION_SET_CURRENT_DATA::deser(version, payload).map(Self::MISSION_SET_CURRENT)
33058 }
33059 MISSION_WRITE_PARTIAL_LIST_DATA::ID => {
33060 MISSION_WRITE_PARTIAL_LIST_DATA::deser(version, payload)
33061 .map(Self::MISSION_WRITE_PARTIAL_LIST)
33062 }
33063 MOUNT_ORIENTATION_DATA::ID => {
33064 MOUNT_ORIENTATION_DATA::deser(version, payload).map(Self::MOUNT_ORIENTATION)
33065 }
33066 NAMED_VALUE_FLOAT_DATA::ID => {
33067 NAMED_VALUE_FLOAT_DATA::deser(version, payload).map(Self::NAMED_VALUE_FLOAT)
33068 }
33069 NAMED_VALUE_INT_DATA::ID => {
33070 NAMED_VALUE_INT_DATA::deser(version, payload).map(Self::NAMED_VALUE_INT)
33071 }
33072 NAV_CONTROLLER_OUTPUT_DATA::ID => {
33073 NAV_CONTROLLER_OUTPUT_DATA::deser(version, payload).map(Self::NAV_CONTROLLER_OUTPUT)
33074 }
33075 OBSTACLE_DISTANCE_DATA::ID => {
33076 OBSTACLE_DISTANCE_DATA::deser(version, payload).map(Self::OBSTACLE_DISTANCE)
33077 }
33078 ODOMETRY_DATA::ID => ODOMETRY_DATA::deser(version, payload).map(Self::ODOMETRY),
33079 ONBOARD_COMPUTER_STATUS_DATA::ID => {
33080 ONBOARD_COMPUTER_STATUS_DATA::deser(version, payload)
33081 .map(Self::ONBOARD_COMPUTER_STATUS)
33082 }
33083 OPEN_DRONE_ID_ARM_STATUS_DATA::ID => {
33084 OPEN_DRONE_ID_ARM_STATUS_DATA::deser(version, payload)
33085 .map(Self::OPEN_DRONE_ID_ARM_STATUS)
33086 }
33087 OPEN_DRONE_ID_AUTHENTICATION_DATA::ID => {
33088 OPEN_DRONE_ID_AUTHENTICATION_DATA::deser(version, payload)
33089 .map(Self::OPEN_DRONE_ID_AUTHENTICATION)
33090 }
33091 OPEN_DRONE_ID_BASIC_ID_DATA::ID => OPEN_DRONE_ID_BASIC_ID_DATA::deser(version, payload)
33092 .map(Self::OPEN_DRONE_ID_BASIC_ID),
33093 OPEN_DRONE_ID_LOCATION_DATA::ID => OPEN_DRONE_ID_LOCATION_DATA::deser(version, payload)
33094 .map(Self::OPEN_DRONE_ID_LOCATION),
33095 OPEN_DRONE_ID_MESSAGE_PACK_DATA::ID => {
33096 OPEN_DRONE_ID_MESSAGE_PACK_DATA::deser(version, payload)
33097 .map(Self::OPEN_DRONE_ID_MESSAGE_PACK)
33098 }
33099 OPEN_DRONE_ID_OPERATOR_ID_DATA::ID => {
33100 OPEN_DRONE_ID_OPERATOR_ID_DATA::deser(version, payload)
33101 .map(Self::OPEN_DRONE_ID_OPERATOR_ID)
33102 }
33103 OPEN_DRONE_ID_SELF_ID_DATA::ID => {
33104 OPEN_DRONE_ID_SELF_ID_DATA::deser(version, payload).map(Self::OPEN_DRONE_ID_SELF_ID)
33105 }
33106 OPEN_DRONE_ID_SYSTEM_DATA::ID => {
33107 OPEN_DRONE_ID_SYSTEM_DATA::deser(version, payload).map(Self::OPEN_DRONE_ID_SYSTEM)
33108 }
33109 OPEN_DRONE_ID_SYSTEM_UPDATE_DATA::ID => {
33110 OPEN_DRONE_ID_SYSTEM_UPDATE_DATA::deser(version, payload)
33111 .map(Self::OPEN_DRONE_ID_SYSTEM_UPDATE)
33112 }
33113 OPTICAL_FLOW_DATA::ID => {
33114 OPTICAL_FLOW_DATA::deser(version, payload).map(Self::OPTICAL_FLOW)
33115 }
33116 OPTICAL_FLOW_RAD_DATA::ID => {
33117 OPTICAL_FLOW_RAD_DATA::deser(version, payload).map(Self::OPTICAL_FLOW_RAD)
33118 }
33119 ORBIT_EXECUTION_STATUS_DATA::ID => ORBIT_EXECUTION_STATUS_DATA::deser(version, payload)
33120 .map(Self::ORBIT_EXECUTION_STATUS),
33121 PARAM_EXT_ACK_DATA::ID => {
33122 PARAM_EXT_ACK_DATA::deser(version, payload).map(Self::PARAM_EXT_ACK)
33123 }
33124 PARAM_EXT_REQUEST_LIST_DATA::ID => PARAM_EXT_REQUEST_LIST_DATA::deser(version, payload)
33125 .map(Self::PARAM_EXT_REQUEST_LIST),
33126 PARAM_EXT_REQUEST_READ_DATA::ID => PARAM_EXT_REQUEST_READ_DATA::deser(version, payload)
33127 .map(Self::PARAM_EXT_REQUEST_READ),
33128 PARAM_EXT_SET_DATA::ID => {
33129 PARAM_EXT_SET_DATA::deser(version, payload).map(Self::PARAM_EXT_SET)
33130 }
33131 PARAM_EXT_VALUE_DATA::ID => {
33132 PARAM_EXT_VALUE_DATA::deser(version, payload).map(Self::PARAM_EXT_VALUE)
33133 }
33134 PARAM_MAP_RC_DATA::ID => {
33135 PARAM_MAP_RC_DATA::deser(version, payload).map(Self::PARAM_MAP_RC)
33136 }
33137 PARAM_REQUEST_LIST_DATA::ID => {
33138 PARAM_REQUEST_LIST_DATA::deser(version, payload).map(Self::PARAM_REQUEST_LIST)
33139 }
33140 PARAM_REQUEST_READ_DATA::ID => {
33141 PARAM_REQUEST_READ_DATA::deser(version, payload).map(Self::PARAM_REQUEST_READ)
33142 }
33143 PARAM_SET_DATA::ID => PARAM_SET_DATA::deser(version, payload).map(Self::PARAM_SET),
33144 PARAM_VALUE_DATA::ID => {
33145 PARAM_VALUE_DATA::deser(version, payload).map(Self::PARAM_VALUE)
33146 }
33147 PING_DATA::ID => PING_DATA::deser(version, payload).map(Self::PING),
33148 PLAY_TUNE_DATA::ID => PLAY_TUNE_DATA::deser(version, payload).map(Self::PLAY_TUNE),
33149 PLAY_TUNE_V2_DATA::ID => {
33150 PLAY_TUNE_V2_DATA::deser(version, payload).map(Self::PLAY_TUNE_V2)
33151 }
33152 POSITION_TARGET_GLOBAL_INT_DATA::ID => {
33153 POSITION_TARGET_GLOBAL_INT_DATA::deser(version, payload)
33154 .map(Self::POSITION_TARGET_GLOBAL_INT)
33155 }
33156 POSITION_TARGET_LOCAL_NED_DATA::ID => {
33157 POSITION_TARGET_LOCAL_NED_DATA::deser(version, payload)
33158 .map(Self::POSITION_TARGET_LOCAL_NED)
33159 }
33160 POWER_STATUS_DATA::ID => {
33161 POWER_STATUS_DATA::deser(version, payload).map(Self::POWER_STATUS)
33162 }
33163 PROTOCOL_VERSION_DATA::ID => {
33164 PROTOCOL_VERSION_DATA::deser(version, payload).map(Self::PROTOCOL_VERSION)
33165 }
33166 RADIO_STATUS_DATA::ID => {
33167 RADIO_STATUS_DATA::deser(version, payload).map(Self::RADIO_STATUS)
33168 }
33169 RAW_IMU_DATA::ID => RAW_IMU_DATA::deser(version, payload).map(Self::RAW_IMU),
33170 RAW_PRESSURE_DATA::ID => {
33171 RAW_PRESSURE_DATA::deser(version, payload).map(Self::RAW_PRESSURE)
33172 }
33173 RAW_RPM_DATA::ID => RAW_RPM_DATA::deser(version, payload).map(Self::RAW_RPM),
33174 RC_CHANNELS_DATA::ID => {
33175 RC_CHANNELS_DATA::deser(version, payload).map(Self::RC_CHANNELS)
33176 }
33177 RC_CHANNELS_OVERRIDE_DATA::ID => {
33178 RC_CHANNELS_OVERRIDE_DATA::deser(version, payload).map(Self::RC_CHANNELS_OVERRIDE)
33179 }
33180 RC_CHANNELS_RAW_DATA::ID => {
33181 RC_CHANNELS_RAW_DATA::deser(version, payload).map(Self::RC_CHANNELS_RAW)
33182 }
33183 RC_CHANNELS_SCALED_DATA::ID => {
33184 RC_CHANNELS_SCALED_DATA::deser(version, payload).map(Self::RC_CHANNELS_SCALED)
33185 }
33186 REQUEST_DATA_STREAM_DATA::ID => {
33187 REQUEST_DATA_STREAM_DATA::deser(version, payload).map(Self::REQUEST_DATA_STREAM)
33188 }
33189 REQUEST_EVENT_DATA::ID => {
33190 REQUEST_EVENT_DATA::deser(version, payload).map(Self::REQUEST_EVENT)
33191 }
33192 RESOURCE_REQUEST_DATA::ID => {
33193 RESOURCE_REQUEST_DATA::deser(version, payload).map(Self::RESOURCE_REQUEST)
33194 }
33195 RESPONSE_EVENT_ERROR_DATA::ID => {
33196 RESPONSE_EVENT_ERROR_DATA::deser(version, payload).map(Self::RESPONSE_EVENT_ERROR)
33197 }
33198 SAFETY_ALLOWED_AREA_DATA::ID => {
33199 SAFETY_ALLOWED_AREA_DATA::deser(version, payload).map(Self::SAFETY_ALLOWED_AREA)
33200 }
33201 SAFETY_SET_ALLOWED_AREA_DATA::ID => {
33202 SAFETY_SET_ALLOWED_AREA_DATA::deser(version, payload)
33203 .map(Self::SAFETY_SET_ALLOWED_AREA)
33204 }
33205 SCALED_IMU_DATA::ID => SCALED_IMU_DATA::deser(version, payload).map(Self::SCALED_IMU),
33206 SCALED_IMU2_DATA::ID => {
33207 SCALED_IMU2_DATA::deser(version, payload).map(Self::SCALED_IMU2)
33208 }
33209 SCALED_IMU3_DATA::ID => {
33210 SCALED_IMU3_DATA::deser(version, payload).map(Self::SCALED_IMU3)
33211 }
33212 SCALED_PRESSURE_DATA::ID => {
33213 SCALED_PRESSURE_DATA::deser(version, payload).map(Self::SCALED_PRESSURE)
33214 }
33215 SCALED_PRESSURE2_DATA::ID => {
33216 SCALED_PRESSURE2_DATA::deser(version, payload).map(Self::SCALED_PRESSURE2)
33217 }
33218 SCALED_PRESSURE3_DATA::ID => {
33219 SCALED_PRESSURE3_DATA::deser(version, payload).map(Self::SCALED_PRESSURE3)
33220 }
33221 SERIAL_CONTROL_DATA::ID => {
33222 SERIAL_CONTROL_DATA::deser(version, payload).map(Self::SERIAL_CONTROL)
33223 }
33224 SERVO_OUTPUT_RAW_DATA::ID => {
33225 SERVO_OUTPUT_RAW_DATA::deser(version, payload).map(Self::SERVO_OUTPUT_RAW)
33226 }
33227 SETUP_SIGNING_DATA::ID => {
33228 SETUP_SIGNING_DATA::deser(version, payload).map(Self::SETUP_SIGNING)
33229 }
33230 SET_ACTUATOR_CONTROL_TARGET_DATA::ID => {
33231 SET_ACTUATOR_CONTROL_TARGET_DATA::deser(version, payload)
33232 .map(Self::SET_ACTUATOR_CONTROL_TARGET)
33233 }
33234 SET_ATTITUDE_TARGET_DATA::ID => {
33235 SET_ATTITUDE_TARGET_DATA::deser(version, payload).map(Self::SET_ATTITUDE_TARGET)
33236 }
33237 SET_GPS_GLOBAL_ORIGIN_DATA::ID => {
33238 SET_GPS_GLOBAL_ORIGIN_DATA::deser(version, payload).map(Self::SET_GPS_GLOBAL_ORIGIN)
33239 }
33240 SET_HOME_POSITION_DATA::ID => {
33241 SET_HOME_POSITION_DATA::deser(version, payload).map(Self::SET_HOME_POSITION)
33242 }
33243 SET_MODE_DATA::ID => SET_MODE_DATA::deser(version, payload).map(Self::SET_MODE),
33244 SET_POSITION_TARGET_GLOBAL_INT_DATA::ID => {
33245 SET_POSITION_TARGET_GLOBAL_INT_DATA::deser(version, payload)
33246 .map(Self::SET_POSITION_TARGET_GLOBAL_INT)
33247 }
33248 SET_POSITION_TARGET_LOCAL_NED_DATA::ID => {
33249 SET_POSITION_TARGET_LOCAL_NED_DATA::deser(version, payload)
33250 .map(Self::SET_POSITION_TARGET_LOCAL_NED)
33251 }
33252 SIM_STATE_DATA::ID => SIM_STATE_DATA::deser(version, payload).map(Self::SIM_STATE),
33253 SMART_BATTERY_INFO_DATA::ID => {
33254 SMART_BATTERY_INFO_DATA::deser(version, payload).map(Self::SMART_BATTERY_INFO)
33255 }
33256 STATUSTEXT_DATA::ID => STATUSTEXT_DATA::deser(version, payload).map(Self::STATUSTEXT),
33257 STORAGE_INFORMATION_DATA::ID => {
33258 STORAGE_INFORMATION_DATA::deser(version, payload).map(Self::STORAGE_INFORMATION)
33259 }
33260 SUPPORTED_TUNES_DATA::ID => {
33261 SUPPORTED_TUNES_DATA::deser(version, payload).map(Self::SUPPORTED_TUNES)
33262 }
33263 SYSTEM_TIME_DATA::ID => {
33264 SYSTEM_TIME_DATA::deser(version, payload).map(Self::SYSTEM_TIME)
33265 }
33266 SYS_STATUS_DATA::ID => SYS_STATUS_DATA::deser(version, payload).map(Self::SYS_STATUS),
33267 TERRAIN_CHECK_DATA::ID => {
33268 TERRAIN_CHECK_DATA::deser(version, payload).map(Self::TERRAIN_CHECK)
33269 }
33270 TERRAIN_DATA_DATA::ID => {
33271 TERRAIN_DATA_DATA::deser(version, payload).map(Self::TERRAIN_DATA)
33272 }
33273 TERRAIN_REPORT_DATA::ID => {
33274 TERRAIN_REPORT_DATA::deser(version, payload).map(Self::TERRAIN_REPORT)
33275 }
33276 TERRAIN_REQUEST_DATA::ID => {
33277 TERRAIN_REQUEST_DATA::deser(version, payload).map(Self::TERRAIN_REQUEST)
33278 }
33279 TIMESYNC_DATA::ID => TIMESYNC_DATA::deser(version, payload).map(Self::TIMESYNC),
33280 TIME_ESTIMATE_TO_TARGET_DATA::ID => {
33281 TIME_ESTIMATE_TO_TARGET_DATA::deser(version, payload)
33282 .map(Self::TIME_ESTIMATE_TO_TARGET)
33283 }
33284 TRAJECTORY_REPRESENTATION_BEZIER_DATA::ID => {
33285 TRAJECTORY_REPRESENTATION_BEZIER_DATA::deser(version, payload)
33286 .map(Self::TRAJECTORY_REPRESENTATION_BEZIER)
33287 }
33288 TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA::ID => {
33289 TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA::deser(version, payload)
33290 .map(Self::TRAJECTORY_REPRESENTATION_WAYPOINTS)
33291 }
33292 TUNNEL_DATA::ID => TUNNEL_DATA::deser(version, payload).map(Self::TUNNEL),
33293 UAVCAN_NODE_INFO_DATA::ID => {
33294 UAVCAN_NODE_INFO_DATA::deser(version, payload).map(Self::UAVCAN_NODE_INFO)
33295 }
33296 UAVCAN_NODE_STATUS_DATA::ID => {
33297 UAVCAN_NODE_STATUS_DATA::deser(version, payload).map(Self::UAVCAN_NODE_STATUS)
33298 }
33299 UTM_GLOBAL_POSITION_DATA::ID => {
33300 UTM_GLOBAL_POSITION_DATA::deser(version, payload).map(Self::UTM_GLOBAL_POSITION)
33301 }
33302 V2_EXTENSION_DATA::ID => {
33303 V2_EXTENSION_DATA::deser(version, payload).map(Self::V2_EXTENSION)
33304 }
33305 VFR_HUD_DATA::ID => VFR_HUD_DATA::deser(version, payload).map(Self::VFR_HUD),
33306 VIBRATION_DATA::ID => VIBRATION_DATA::deser(version, payload).map(Self::VIBRATION),
33307 VICON_POSITION_ESTIMATE_DATA::ID => {
33308 VICON_POSITION_ESTIMATE_DATA::deser(version, payload)
33309 .map(Self::VICON_POSITION_ESTIMATE)
33310 }
33311 VIDEO_STREAM_INFORMATION_DATA::ID => {
33312 VIDEO_STREAM_INFORMATION_DATA::deser(version, payload)
33313 .map(Self::VIDEO_STREAM_INFORMATION)
33314 }
33315 VIDEO_STREAM_STATUS_DATA::ID => {
33316 VIDEO_STREAM_STATUS_DATA::deser(version, payload).map(Self::VIDEO_STREAM_STATUS)
33317 }
33318 VISION_POSITION_ESTIMATE_DATA::ID => {
33319 VISION_POSITION_ESTIMATE_DATA::deser(version, payload)
33320 .map(Self::VISION_POSITION_ESTIMATE)
33321 }
33322 VISION_SPEED_ESTIMATE_DATA::ID => {
33323 VISION_SPEED_ESTIMATE_DATA::deser(version, payload).map(Self::VISION_SPEED_ESTIMATE)
33324 }
33325 WHEEL_DISTANCE_DATA::ID => {
33326 WHEEL_DISTANCE_DATA::deser(version, payload).map(Self::WHEEL_DISTANCE)
33327 }
33328 WIFI_CONFIG_AP_DATA::ID => {
33329 WIFI_CONFIG_AP_DATA::deser(version, payload).map(Self::WIFI_CONFIG_AP)
33330 }
33331 WINCH_STATUS_DATA::ID => {
33332 WINCH_STATUS_DATA::deser(version, payload).map(Self::WINCH_STATUS)
33333 }
33334 WIND_COV_DATA::ID => WIND_COV_DATA::deser(version, payload).map(Self::WIND_COV),
33335 _ => Err(::mavlink_core::error::ParserError::UnknownMessage { id }),
33336 }
33337 }
33338 fn message_name(&self) -> &'static str {
33339 match self {
33340 Self::ACTUATOR_CONTROL_TARGET(..) => ACTUATOR_CONTROL_TARGET_DATA::NAME,
33341 Self::ACTUATOR_OUTPUT_STATUS(..) => ACTUATOR_OUTPUT_STATUS_DATA::NAME,
33342 Self::ADSB_VEHICLE(..) => ADSB_VEHICLE_DATA::NAME,
33343 Self::AIS_VESSEL(..) => AIS_VESSEL_DATA::NAME,
33344 Self::ALTITUDE(..) => ALTITUDE_DATA::NAME,
33345 Self::ATTITUDE(..) => ATTITUDE_DATA::NAME,
33346 Self::ATTITUDE_QUATERNION(..) => ATTITUDE_QUATERNION_DATA::NAME,
33347 Self::ATTITUDE_QUATERNION_COV(..) => ATTITUDE_QUATERNION_COV_DATA::NAME,
33348 Self::ATTITUDE_TARGET(..) => ATTITUDE_TARGET_DATA::NAME,
33349 Self::ATT_POS_MOCAP(..) => ATT_POS_MOCAP_DATA::NAME,
33350 Self::AUTH_KEY(..) => AUTH_KEY_DATA::NAME,
33351 Self::AUTOPILOT_STATE_FOR_GIMBAL_DEVICE(..) => {
33352 AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA::NAME
33353 }
33354 Self::AUTOPILOT_VERSION(..) => AUTOPILOT_VERSION_DATA::NAME,
33355 Self::AVAILABLE_MODES(..) => AVAILABLE_MODES_DATA::NAME,
33356 Self::AVAILABLE_MODES_MONITOR(..) => AVAILABLE_MODES_MONITOR_DATA::NAME,
33357 Self::AVSS_DRONE_IMU(..) => AVSS_DRONE_IMU_DATA::NAME,
33358 Self::AVSS_DRONE_OPERATION_MODE(..) => AVSS_DRONE_OPERATION_MODE_DATA::NAME,
33359 Self::AVSS_DRONE_POSITION(..) => AVSS_DRONE_POSITION_DATA::NAME,
33360 Self::AVSS_PRS_SYS_STATUS(..) => AVSS_PRS_SYS_STATUS_DATA::NAME,
33361 Self::BATTERY_INFO(..) => BATTERY_INFO_DATA::NAME,
33362 Self::BATTERY_STATUS(..) => BATTERY_STATUS_DATA::NAME,
33363 Self::BUTTON_CHANGE(..) => BUTTON_CHANGE_DATA::NAME,
33364 Self::CAMERA_CAPTURE_STATUS(..) => CAMERA_CAPTURE_STATUS_DATA::NAME,
33365 Self::CAMERA_FOV_STATUS(..) => CAMERA_FOV_STATUS_DATA::NAME,
33366 Self::CAMERA_IMAGE_CAPTURED(..) => CAMERA_IMAGE_CAPTURED_DATA::NAME,
33367 Self::CAMERA_INFORMATION(..) => CAMERA_INFORMATION_DATA::NAME,
33368 Self::CAMERA_SETTINGS(..) => CAMERA_SETTINGS_DATA::NAME,
33369 Self::CAMERA_THERMAL_RANGE(..) => CAMERA_THERMAL_RANGE_DATA::NAME,
33370 Self::CAMERA_TRACKING_GEO_STATUS(..) => CAMERA_TRACKING_GEO_STATUS_DATA::NAME,
33371 Self::CAMERA_TRACKING_IMAGE_STATUS(..) => CAMERA_TRACKING_IMAGE_STATUS_DATA::NAME,
33372 Self::CAMERA_TRIGGER(..) => CAMERA_TRIGGER_DATA::NAME,
33373 Self::CANFD_FRAME(..) => CANFD_FRAME_DATA::NAME,
33374 Self::CAN_FILTER_MODIFY(..) => CAN_FILTER_MODIFY_DATA::NAME,
33375 Self::CAN_FRAME(..) => CAN_FRAME_DATA::NAME,
33376 Self::CELLULAR_CONFIG(..) => CELLULAR_CONFIG_DATA::NAME,
33377 Self::CELLULAR_STATUS(..) => CELLULAR_STATUS_DATA::NAME,
33378 Self::CHANGE_OPERATOR_CONTROL(..) => CHANGE_OPERATOR_CONTROL_DATA::NAME,
33379 Self::CHANGE_OPERATOR_CONTROL_ACK(..) => CHANGE_OPERATOR_CONTROL_ACK_DATA::NAME,
33380 Self::COLLISION(..) => COLLISION_DATA::NAME,
33381 Self::COMMAND_ACK(..) => COMMAND_ACK_DATA::NAME,
33382 Self::COMMAND_CANCEL(..) => COMMAND_CANCEL_DATA::NAME,
33383 Self::COMMAND_INT(..) => COMMAND_INT_DATA::NAME,
33384 Self::COMMAND_LONG(..) => COMMAND_LONG_DATA::NAME,
33385 Self::COMPONENT_INFORMATION(..) => COMPONENT_INFORMATION_DATA::NAME,
33386 Self::COMPONENT_INFORMATION_BASIC(..) => COMPONENT_INFORMATION_BASIC_DATA::NAME,
33387 Self::COMPONENT_METADATA(..) => COMPONENT_METADATA_DATA::NAME,
33388 Self::CONTROL_SYSTEM_STATE(..) => CONTROL_SYSTEM_STATE_DATA::NAME,
33389 Self::CURRENT_EVENT_SEQUENCE(..) => CURRENT_EVENT_SEQUENCE_DATA::NAME,
33390 Self::CURRENT_MODE(..) => CURRENT_MODE_DATA::NAME,
33391 Self::DATA_STREAM(..) => DATA_STREAM_DATA::NAME,
33392 Self::DATA_TRANSMISSION_HANDSHAKE(..) => DATA_TRANSMISSION_HANDSHAKE_DATA::NAME,
33393 Self::DEBUG(..) => DEBUG_DATA::NAME,
33394 Self::DEBUG_FLOAT_ARRAY(..) => DEBUG_FLOAT_ARRAY_DATA::NAME,
33395 Self::DEBUG_VECT(..) => DEBUG_VECT_DATA::NAME,
33396 Self::DISTANCE_SENSOR(..) => DISTANCE_SENSOR_DATA::NAME,
33397 Self::EFI_STATUS(..) => EFI_STATUS_DATA::NAME,
33398 Self::ENCAPSULATED_DATA(..) => ENCAPSULATED_DATA_DATA::NAME,
33399 Self::ESC_INFO(..) => ESC_INFO_DATA::NAME,
33400 Self::ESC_STATUS(..) => ESC_STATUS_DATA::NAME,
33401 Self::ESTIMATOR_STATUS(..) => ESTIMATOR_STATUS_DATA::NAME,
33402 Self::EVENT(..) => EVENT_DATA::NAME,
33403 Self::EXTENDED_SYS_STATE(..) => EXTENDED_SYS_STATE_DATA::NAME,
33404 Self::FENCE_STATUS(..) => FENCE_STATUS_DATA::NAME,
33405 Self::FILE_TRANSFER_PROTOCOL(..) => FILE_TRANSFER_PROTOCOL_DATA::NAME,
33406 Self::FLIGHT_INFORMATION(..) => FLIGHT_INFORMATION_DATA::NAME,
33407 Self::FOLLOW_TARGET(..) => FOLLOW_TARGET_DATA::NAME,
33408 Self::FUEL_STATUS(..) => FUEL_STATUS_DATA::NAME,
33409 Self::GENERATOR_STATUS(..) => GENERATOR_STATUS_DATA::NAME,
33410 Self::GIMBAL_DEVICE_ATTITUDE_STATUS(..) => GIMBAL_DEVICE_ATTITUDE_STATUS_DATA::NAME,
33411 Self::GIMBAL_DEVICE_INFORMATION(..) => GIMBAL_DEVICE_INFORMATION_DATA::NAME,
33412 Self::GIMBAL_DEVICE_SET_ATTITUDE(..) => GIMBAL_DEVICE_SET_ATTITUDE_DATA::NAME,
33413 Self::GIMBAL_MANAGER_INFORMATION(..) => GIMBAL_MANAGER_INFORMATION_DATA::NAME,
33414 Self::GIMBAL_MANAGER_SET_ATTITUDE(..) => GIMBAL_MANAGER_SET_ATTITUDE_DATA::NAME,
33415 Self::GIMBAL_MANAGER_SET_MANUAL_CONTROL(..) => {
33416 GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA::NAME
33417 }
33418 Self::GIMBAL_MANAGER_SET_PITCHYAW(..) => GIMBAL_MANAGER_SET_PITCHYAW_DATA::NAME,
33419 Self::GIMBAL_MANAGER_STATUS(..) => GIMBAL_MANAGER_STATUS_DATA::NAME,
33420 Self::GLOBAL_POSITION_INT(..) => GLOBAL_POSITION_INT_DATA::NAME,
33421 Self::GLOBAL_POSITION_INT_COV(..) => GLOBAL_POSITION_INT_COV_DATA::NAME,
33422 Self::GLOBAL_VISION_POSITION_ESTIMATE(..) => GLOBAL_VISION_POSITION_ESTIMATE_DATA::NAME,
33423 Self::GPS2_RAW(..) => GPS2_RAW_DATA::NAME,
33424 Self::GPS2_RTK(..) => GPS2_RTK_DATA::NAME,
33425 Self::GPS_GLOBAL_ORIGIN(..) => GPS_GLOBAL_ORIGIN_DATA::NAME,
33426 Self::GPS_INJECT_DATA(..) => GPS_INJECT_DATA_DATA::NAME,
33427 Self::GPS_INPUT(..) => GPS_INPUT_DATA::NAME,
33428 Self::GPS_RAW_INT(..) => GPS_RAW_INT_DATA::NAME,
33429 Self::GPS_RTCM_DATA(..) => GPS_RTCM_DATA_DATA::NAME,
33430 Self::GPS_RTK(..) => GPS_RTK_DATA::NAME,
33431 Self::GPS_STATUS(..) => GPS_STATUS_DATA::NAME,
33432 Self::HEARTBEAT(..) => HEARTBEAT_DATA::NAME,
33433 Self::HIGHRES_IMU(..) => HIGHRES_IMU_DATA::NAME,
33434 Self::HIGH_LATENCY(..) => HIGH_LATENCY_DATA::NAME,
33435 Self::HIGH_LATENCY2(..) => HIGH_LATENCY2_DATA::NAME,
33436 Self::HIL_ACTUATOR_CONTROLS(..) => HIL_ACTUATOR_CONTROLS_DATA::NAME,
33437 Self::HIL_CONTROLS(..) => HIL_CONTROLS_DATA::NAME,
33438 Self::HIL_GPS(..) => HIL_GPS_DATA::NAME,
33439 Self::HIL_OPTICAL_FLOW(..) => HIL_OPTICAL_FLOW_DATA::NAME,
33440 Self::HIL_RC_INPUTS_RAW(..) => HIL_RC_INPUTS_RAW_DATA::NAME,
33441 Self::HIL_SENSOR(..) => HIL_SENSOR_DATA::NAME,
33442 Self::HIL_STATE(..) => HIL_STATE_DATA::NAME,
33443 Self::HIL_STATE_QUATERNION(..) => HIL_STATE_QUATERNION_DATA::NAME,
33444 Self::HOME_POSITION(..) => HOME_POSITION_DATA::NAME,
33445 Self::HYGROMETER_SENSOR(..) => HYGROMETER_SENSOR_DATA::NAME,
33446 Self::ILLUMINATOR_STATUS(..) => ILLUMINATOR_STATUS_DATA::NAME,
33447 Self::ISBD_LINK_STATUS(..) => ISBD_LINK_STATUS_DATA::NAME,
33448 Self::LANDING_TARGET(..) => LANDING_TARGET_DATA::NAME,
33449 Self::LINK_NODE_STATUS(..) => LINK_NODE_STATUS_DATA::NAME,
33450 Self::LOCAL_POSITION_NED(..) => LOCAL_POSITION_NED_DATA::NAME,
33451 Self::LOCAL_POSITION_NED_COV(..) => LOCAL_POSITION_NED_COV_DATA::NAME,
33452 Self::LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET(..) => {
33453 LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA::NAME
33454 }
33455 Self::LOGGING_ACK(..) => LOGGING_ACK_DATA::NAME,
33456 Self::LOGGING_DATA(..) => LOGGING_DATA_DATA::NAME,
33457 Self::LOGGING_DATA_ACKED(..) => LOGGING_DATA_ACKED_DATA::NAME,
33458 Self::LOG_DATA(..) => LOG_DATA_DATA::NAME,
33459 Self::LOG_ENTRY(..) => LOG_ENTRY_DATA::NAME,
33460 Self::LOG_ERASE(..) => LOG_ERASE_DATA::NAME,
33461 Self::LOG_REQUEST_DATA(..) => LOG_REQUEST_DATA_DATA::NAME,
33462 Self::LOG_REQUEST_END(..) => LOG_REQUEST_END_DATA::NAME,
33463 Self::LOG_REQUEST_LIST(..) => LOG_REQUEST_LIST_DATA::NAME,
33464 Self::MAG_CAL_REPORT(..) => MAG_CAL_REPORT_DATA::NAME,
33465 Self::MANUAL_CONTROL(..) => MANUAL_CONTROL_DATA::NAME,
33466 Self::MANUAL_SETPOINT(..) => MANUAL_SETPOINT_DATA::NAME,
33467 Self::MEMORY_VECT(..) => MEMORY_VECT_DATA::NAME,
33468 Self::MESSAGE_INTERVAL(..) => MESSAGE_INTERVAL_DATA::NAME,
33469 Self::MISSION_ACK(..) => MISSION_ACK_DATA::NAME,
33470 Self::MISSION_CLEAR_ALL(..) => MISSION_CLEAR_ALL_DATA::NAME,
33471 Self::MISSION_COUNT(..) => MISSION_COUNT_DATA::NAME,
33472 Self::MISSION_CURRENT(..) => MISSION_CURRENT_DATA::NAME,
33473 Self::MISSION_ITEM(..) => MISSION_ITEM_DATA::NAME,
33474 Self::MISSION_ITEM_INT(..) => MISSION_ITEM_INT_DATA::NAME,
33475 Self::MISSION_ITEM_REACHED(..) => MISSION_ITEM_REACHED_DATA::NAME,
33476 Self::MISSION_REQUEST(..) => MISSION_REQUEST_DATA::NAME,
33477 Self::MISSION_REQUEST_INT(..) => MISSION_REQUEST_INT_DATA::NAME,
33478 Self::MISSION_REQUEST_LIST(..) => MISSION_REQUEST_LIST_DATA::NAME,
33479 Self::MISSION_REQUEST_PARTIAL_LIST(..) => MISSION_REQUEST_PARTIAL_LIST_DATA::NAME,
33480 Self::MISSION_SET_CURRENT(..) => MISSION_SET_CURRENT_DATA::NAME,
33481 Self::MISSION_WRITE_PARTIAL_LIST(..) => MISSION_WRITE_PARTIAL_LIST_DATA::NAME,
33482 Self::MOUNT_ORIENTATION(..) => MOUNT_ORIENTATION_DATA::NAME,
33483 Self::NAMED_VALUE_FLOAT(..) => NAMED_VALUE_FLOAT_DATA::NAME,
33484 Self::NAMED_VALUE_INT(..) => NAMED_VALUE_INT_DATA::NAME,
33485 Self::NAV_CONTROLLER_OUTPUT(..) => NAV_CONTROLLER_OUTPUT_DATA::NAME,
33486 Self::OBSTACLE_DISTANCE(..) => OBSTACLE_DISTANCE_DATA::NAME,
33487 Self::ODOMETRY(..) => ODOMETRY_DATA::NAME,
33488 Self::ONBOARD_COMPUTER_STATUS(..) => ONBOARD_COMPUTER_STATUS_DATA::NAME,
33489 Self::OPEN_DRONE_ID_ARM_STATUS(..) => OPEN_DRONE_ID_ARM_STATUS_DATA::NAME,
33490 Self::OPEN_DRONE_ID_AUTHENTICATION(..) => OPEN_DRONE_ID_AUTHENTICATION_DATA::NAME,
33491 Self::OPEN_DRONE_ID_BASIC_ID(..) => OPEN_DRONE_ID_BASIC_ID_DATA::NAME,
33492 Self::OPEN_DRONE_ID_LOCATION(..) => OPEN_DRONE_ID_LOCATION_DATA::NAME,
33493 Self::OPEN_DRONE_ID_MESSAGE_PACK(..) => OPEN_DRONE_ID_MESSAGE_PACK_DATA::NAME,
33494 Self::OPEN_DRONE_ID_OPERATOR_ID(..) => OPEN_DRONE_ID_OPERATOR_ID_DATA::NAME,
33495 Self::OPEN_DRONE_ID_SELF_ID(..) => OPEN_DRONE_ID_SELF_ID_DATA::NAME,
33496 Self::OPEN_DRONE_ID_SYSTEM(..) => OPEN_DRONE_ID_SYSTEM_DATA::NAME,
33497 Self::OPEN_DRONE_ID_SYSTEM_UPDATE(..) => OPEN_DRONE_ID_SYSTEM_UPDATE_DATA::NAME,
33498 Self::OPTICAL_FLOW(..) => OPTICAL_FLOW_DATA::NAME,
33499 Self::OPTICAL_FLOW_RAD(..) => OPTICAL_FLOW_RAD_DATA::NAME,
33500 Self::ORBIT_EXECUTION_STATUS(..) => ORBIT_EXECUTION_STATUS_DATA::NAME,
33501 Self::PARAM_EXT_ACK(..) => PARAM_EXT_ACK_DATA::NAME,
33502 Self::PARAM_EXT_REQUEST_LIST(..) => PARAM_EXT_REQUEST_LIST_DATA::NAME,
33503 Self::PARAM_EXT_REQUEST_READ(..) => PARAM_EXT_REQUEST_READ_DATA::NAME,
33504 Self::PARAM_EXT_SET(..) => PARAM_EXT_SET_DATA::NAME,
33505 Self::PARAM_EXT_VALUE(..) => PARAM_EXT_VALUE_DATA::NAME,
33506 Self::PARAM_MAP_RC(..) => PARAM_MAP_RC_DATA::NAME,
33507 Self::PARAM_REQUEST_LIST(..) => PARAM_REQUEST_LIST_DATA::NAME,
33508 Self::PARAM_REQUEST_READ(..) => PARAM_REQUEST_READ_DATA::NAME,
33509 Self::PARAM_SET(..) => PARAM_SET_DATA::NAME,
33510 Self::PARAM_VALUE(..) => PARAM_VALUE_DATA::NAME,
33511 Self::PING(..) => PING_DATA::NAME,
33512 Self::PLAY_TUNE(..) => PLAY_TUNE_DATA::NAME,
33513 Self::PLAY_TUNE_V2(..) => PLAY_TUNE_V2_DATA::NAME,
33514 Self::POSITION_TARGET_GLOBAL_INT(..) => POSITION_TARGET_GLOBAL_INT_DATA::NAME,
33515 Self::POSITION_TARGET_LOCAL_NED(..) => POSITION_TARGET_LOCAL_NED_DATA::NAME,
33516 Self::POWER_STATUS(..) => POWER_STATUS_DATA::NAME,
33517 Self::PROTOCOL_VERSION(..) => PROTOCOL_VERSION_DATA::NAME,
33518 Self::RADIO_STATUS(..) => RADIO_STATUS_DATA::NAME,
33519 Self::RAW_IMU(..) => RAW_IMU_DATA::NAME,
33520 Self::RAW_PRESSURE(..) => RAW_PRESSURE_DATA::NAME,
33521 Self::RAW_RPM(..) => RAW_RPM_DATA::NAME,
33522 Self::RC_CHANNELS(..) => RC_CHANNELS_DATA::NAME,
33523 Self::RC_CHANNELS_OVERRIDE(..) => RC_CHANNELS_OVERRIDE_DATA::NAME,
33524 Self::RC_CHANNELS_RAW(..) => RC_CHANNELS_RAW_DATA::NAME,
33525 Self::RC_CHANNELS_SCALED(..) => RC_CHANNELS_SCALED_DATA::NAME,
33526 Self::REQUEST_DATA_STREAM(..) => REQUEST_DATA_STREAM_DATA::NAME,
33527 Self::REQUEST_EVENT(..) => REQUEST_EVENT_DATA::NAME,
33528 Self::RESOURCE_REQUEST(..) => RESOURCE_REQUEST_DATA::NAME,
33529 Self::RESPONSE_EVENT_ERROR(..) => RESPONSE_EVENT_ERROR_DATA::NAME,
33530 Self::SAFETY_ALLOWED_AREA(..) => SAFETY_ALLOWED_AREA_DATA::NAME,
33531 Self::SAFETY_SET_ALLOWED_AREA(..) => SAFETY_SET_ALLOWED_AREA_DATA::NAME,
33532 Self::SCALED_IMU(..) => SCALED_IMU_DATA::NAME,
33533 Self::SCALED_IMU2(..) => SCALED_IMU2_DATA::NAME,
33534 Self::SCALED_IMU3(..) => SCALED_IMU3_DATA::NAME,
33535 Self::SCALED_PRESSURE(..) => SCALED_PRESSURE_DATA::NAME,
33536 Self::SCALED_PRESSURE2(..) => SCALED_PRESSURE2_DATA::NAME,
33537 Self::SCALED_PRESSURE3(..) => SCALED_PRESSURE3_DATA::NAME,
33538 Self::SERIAL_CONTROL(..) => SERIAL_CONTROL_DATA::NAME,
33539 Self::SERVO_OUTPUT_RAW(..) => SERVO_OUTPUT_RAW_DATA::NAME,
33540 Self::SETUP_SIGNING(..) => SETUP_SIGNING_DATA::NAME,
33541 Self::SET_ACTUATOR_CONTROL_TARGET(..) => SET_ACTUATOR_CONTROL_TARGET_DATA::NAME,
33542 Self::SET_ATTITUDE_TARGET(..) => SET_ATTITUDE_TARGET_DATA::NAME,
33543 Self::SET_GPS_GLOBAL_ORIGIN(..) => SET_GPS_GLOBAL_ORIGIN_DATA::NAME,
33544 Self::SET_HOME_POSITION(..) => SET_HOME_POSITION_DATA::NAME,
33545 Self::SET_MODE(..) => SET_MODE_DATA::NAME,
33546 Self::SET_POSITION_TARGET_GLOBAL_INT(..) => SET_POSITION_TARGET_GLOBAL_INT_DATA::NAME,
33547 Self::SET_POSITION_TARGET_LOCAL_NED(..) => SET_POSITION_TARGET_LOCAL_NED_DATA::NAME,
33548 Self::SIM_STATE(..) => SIM_STATE_DATA::NAME,
33549 Self::SMART_BATTERY_INFO(..) => SMART_BATTERY_INFO_DATA::NAME,
33550 Self::STATUSTEXT(..) => STATUSTEXT_DATA::NAME,
33551 Self::STORAGE_INFORMATION(..) => STORAGE_INFORMATION_DATA::NAME,
33552 Self::SUPPORTED_TUNES(..) => SUPPORTED_TUNES_DATA::NAME,
33553 Self::SYSTEM_TIME(..) => SYSTEM_TIME_DATA::NAME,
33554 Self::SYS_STATUS(..) => SYS_STATUS_DATA::NAME,
33555 Self::TERRAIN_CHECK(..) => TERRAIN_CHECK_DATA::NAME,
33556 Self::TERRAIN_DATA(..) => TERRAIN_DATA_DATA::NAME,
33557 Self::TERRAIN_REPORT(..) => TERRAIN_REPORT_DATA::NAME,
33558 Self::TERRAIN_REQUEST(..) => TERRAIN_REQUEST_DATA::NAME,
33559 Self::TIMESYNC(..) => TIMESYNC_DATA::NAME,
33560 Self::TIME_ESTIMATE_TO_TARGET(..) => TIME_ESTIMATE_TO_TARGET_DATA::NAME,
33561 Self::TRAJECTORY_REPRESENTATION_BEZIER(..) => {
33562 TRAJECTORY_REPRESENTATION_BEZIER_DATA::NAME
33563 }
33564 Self::TRAJECTORY_REPRESENTATION_WAYPOINTS(..) => {
33565 TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA::NAME
33566 }
33567 Self::TUNNEL(..) => TUNNEL_DATA::NAME,
33568 Self::UAVCAN_NODE_INFO(..) => UAVCAN_NODE_INFO_DATA::NAME,
33569 Self::UAVCAN_NODE_STATUS(..) => UAVCAN_NODE_STATUS_DATA::NAME,
33570 Self::UTM_GLOBAL_POSITION(..) => UTM_GLOBAL_POSITION_DATA::NAME,
33571 Self::V2_EXTENSION(..) => V2_EXTENSION_DATA::NAME,
33572 Self::VFR_HUD(..) => VFR_HUD_DATA::NAME,
33573 Self::VIBRATION(..) => VIBRATION_DATA::NAME,
33574 Self::VICON_POSITION_ESTIMATE(..) => VICON_POSITION_ESTIMATE_DATA::NAME,
33575 Self::VIDEO_STREAM_INFORMATION(..) => VIDEO_STREAM_INFORMATION_DATA::NAME,
33576 Self::VIDEO_STREAM_STATUS(..) => VIDEO_STREAM_STATUS_DATA::NAME,
33577 Self::VISION_POSITION_ESTIMATE(..) => VISION_POSITION_ESTIMATE_DATA::NAME,
33578 Self::VISION_SPEED_ESTIMATE(..) => VISION_SPEED_ESTIMATE_DATA::NAME,
33579 Self::WHEEL_DISTANCE(..) => WHEEL_DISTANCE_DATA::NAME,
33580 Self::WIFI_CONFIG_AP(..) => WIFI_CONFIG_AP_DATA::NAME,
33581 Self::WINCH_STATUS(..) => WINCH_STATUS_DATA::NAME,
33582 Self::WIND_COV(..) => WIND_COV_DATA::NAME,
33583 }
33584 }
33585 fn message_id(&self) -> u32 {
33586 match self {
33587 Self::ACTUATOR_CONTROL_TARGET(..) => ACTUATOR_CONTROL_TARGET_DATA::ID,
33588 Self::ACTUATOR_OUTPUT_STATUS(..) => ACTUATOR_OUTPUT_STATUS_DATA::ID,
33589 Self::ADSB_VEHICLE(..) => ADSB_VEHICLE_DATA::ID,
33590 Self::AIS_VESSEL(..) => AIS_VESSEL_DATA::ID,
33591 Self::ALTITUDE(..) => ALTITUDE_DATA::ID,
33592 Self::ATTITUDE(..) => ATTITUDE_DATA::ID,
33593 Self::ATTITUDE_QUATERNION(..) => ATTITUDE_QUATERNION_DATA::ID,
33594 Self::ATTITUDE_QUATERNION_COV(..) => ATTITUDE_QUATERNION_COV_DATA::ID,
33595 Self::ATTITUDE_TARGET(..) => ATTITUDE_TARGET_DATA::ID,
33596 Self::ATT_POS_MOCAP(..) => ATT_POS_MOCAP_DATA::ID,
33597 Self::AUTH_KEY(..) => AUTH_KEY_DATA::ID,
33598 Self::AUTOPILOT_STATE_FOR_GIMBAL_DEVICE(..) => {
33599 AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA::ID
33600 }
33601 Self::AUTOPILOT_VERSION(..) => AUTOPILOT_VERSION_DATA::ID,
33602 Self::AVAILABLE_MODES(..) => AVAILABLE_MODES_DATA::ID,
33603 Self::AVAILABLE_MODES_MONITOR(..) => AVAILABLE_MODES_MONITOR_DATA::ID,
33604 Self::AVSS_DRONE_IMU(..) => AVSS_DRONE_IMU_DATA::ID,
33605 Self::AVSS_DRONE_OPERATION_MODE(..) => AVSS_DRONE_OPERATION_MODE_DATA::ID,
33606 Self::AVSS_DRONE_POSITION(..) => AVSS_DRONE_POSITION_DATA::ID,
33607 Self::AVSS_PRS_SYS_STATUS(..) => AVSS_PRS_SYS_STATUS_DATA::ID,
33608 Self::BATTERY_INFO(..) => BATTERY_INFO_DATA::ID,
33609 Self::BATTERY_STATUS(..) => BATTERY_STATUS_DATA::ID,
33610 Self::BUTTON_CHANGE(..) => BUTTON_CHANGE_DATA::ID,
33611 Self::CAMERA_CAPTURE_STATUS(..) => CAMERA_CAPTURE_STATUS_DATA::ID,
33612 Self::CAMERA_FOV_STATUS(..) => CAMERA_FOV_STATUS_DATA::ID,
33613 Self::CAMERA_IMAGE_CAPTURED(..) => CAMERA_IMAGE_CAPTURED_DATA::ID,
33614 Self::CAMERA_INFORMATION(..) => CAMERA_INFORMATION_DATA::ID,
33615 Self::CAMERA_SETTINGS(..) => CAMERA_SETTINGS_DATA::ID,
33616 Self::CAMERA_THERMAL_RANGE(..) => CAMERA_THERMAL_RANGE_DATA::ID,
33617 Self::CAMERA_TRACKING_GEO_STATUS(..) => CAMERA_TRACKING_GEO_STATUS_DATA::ID,
33618 Self::CAMERA_TRACKING_IMAGE_STATUS(..) => CAMERA_TRACKING_IMAGE_STATUS_DATA::ID,
33619 Self::CAMERA_TRIGGER(..) => CAMERA_TRIGGER_DATA::ID,
33620 Self::CANFD_FRAME(..) => CANFD_FRAME_DATA::ID,
33621 Self::CAN_FILTER_MODIFY(..) => CAN_FILTER_MODIFY_DATA::ID,
33622 Self::CAN_FRAME(..) => CAN_FRAME_DATA::ID,
33623 Self::CELLULAR_CONFIG(..) => CELLULAR_CONFIG_DATA::ID,
33624 Self::CELLULAR_STATUS(..) => CELLULAR_STATUS_DATA::ID,
33625 Self::CHANGE_OPERATOR_CONTROL(..) => CHANGE_OPERATOR_CONTROL_DATA::ID,
33626 Self::CHANGE_OPERATOR_CONTROL_ACK(..) => CHANGE_OPERATOR_CONTROL_ACK_DATA::ID,
33627 Self::COLLISION(..) => COLLISION_DATA::ID,
33628 Self::COMMAND_ACK(..) => COMMAND_ACK_DATA::ID,
33629 Self::COMMAND_CANCEL(..) => COMMAND_CANCEL_DATA::ID,
33630 Self::COMMAND_INT(..) => COMMAND_INT_DATA::ID,
33631 Self::COMMAND_LONG(..) => COMMAND_LONG_DATA::ID,
33632 Self::COMPONENT_INFORMATION(..) => COMPONENT_INFORMATION_DATA::ID,
33633 Self::COMPONENT_INFORMATION_BASIC(..) => COMPONENT_INFORMATION_BASIC_DATA::ID,
33634 Self::COMPONENT_METADATA(..) => COMPONENT_METADATA_DATA::ID,
33635 Self::CONTROL_SYSTEM_STATE(..) => CONTROL_SYSTEM_STATE_DATA::ID,
33636 Self::CURRENT_EVENT_SEQUENCE(..) => CURRENT_EVENT_SEQUENCE_DATA::ID,
33637 Self::CURRENT_MODE(..) => CURRENT_MODE_DATA::ID,
33638 Self::DATA_STREAM(..) => DATA_STREAM_DATA::ID,
33639 Self::DATA_TRANSMISSION_HANDSHAKE(..) => DATA_TRANSMISSION_HANDSHAKE_DATA::ID,
33640 Self::DEBUG(..) => DEBUG_DATA::ID,
33641 Self::DEBUG_FLOAT_ARRAY(..) => DEBUG_FLOAT_ARRAY_DATA::ID,
33642 Self::DEBUG_VECT(..) => DEBUG_VECT_DATA::ID,
33643 Self::DISTANCE_SENSOR(..) => DISTANCE_SENSOR_DATA::ID,
33644 Self::EFI_STATUS(..) => EFI_STATUS_DATA::ID,
33645 Self::ENCAPSULATED_DATA(..) => ENCAPSULATED_DATA_DATA::ID,
33646 Self::ESC_INFO(..) => ESC_INFO_DATA::ID,
33647 Self::ESC_STATUS(..) => ESC_STATUS_DATA::ID,
33648 Self::ESTIMATOR_STATUS(..) => ESTIMATOR_STATUS_DATA::ID,
33649 Self::EVENT(..) => EVENT_DATA::ID,
33650 Self::EXTENDED_SYS_STATE(..) => EXTENDED_SYS_STATE_DATA::ID,
33651 Self::FENCE_STATUS(..) => FENCE_STATUS_DATA::ID,
33652 Self::FILE_TRANSFER_PROTOCOL(..) => FILE_TRANSFER_PROTOCOL_DATA::ID,
33653 Self::FLIGHT_INFORMATION(..) => FLIGHT_INFORMATION_DATA::ID,
33654 Self::FOLLOW_TARGET(..) => FOLLOW_TARGET_DATA::ID,
33655 Self::FUEL_STATUS(..) => FUEL_STATUS_DATA::ID,
33656 Self::GENERATOR_STATUS(..) => GENERATOR_STATUS_DATA::ID,
33657 Self::GIMBAL_DEVICE_ATTITUDE_STATUS(..) => GIMBAL_DEVICE_ATTITUDE_STATUS_DATA::ID,
33658 Self::GIMBAL_DEVICE_INFORMATION(..) => GIMBAL_DEVICE_INFORMATION_DATA::ID,
33659 Self::GIMBAL_DEVICE_SET_ATTITUDE(..) => GIMBAL_DEVICE_SET_ATTITUDE_DATA::ID,
33660 Self::GIMBAL_MANAGER_INFORMATION(..) => GIMBAL_MANAGER_INFORMATION_DATA::ID,
33661 Self::GIMBAL_MANAGER_SET_ATTITUDE(..) => GIMBAL_MANAGER_SET_ATTITUDE_DATA::ID,
33662 Self::GIMBAL_MANAGER_SET_MANUAL_CONTROL(..) => {
33663 GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA::ID
33664 }
33665 Self::GIMBAL_MANAGER_SET_PITCHYAW(..) => GIMBAL_MANAGER_SET_PITCHYAW_DATA::ID,
33666 Self::GIMBAL_MANAGER_STATUS(..) => GIMBAL_MANAGER_STATUS_DATA::ID,
33667 Self::GLOBAL_POSITION_INT(..) => GLOBAL_POSITION_INT_DATA::ID,
33668 Self::GLOBAL_POSITION_INT_COV(..) => GLOBAL_POSITION_INT_COV_DATA::ID,
33669 Self::GLOBAL_VISION_POSITION_ESTIMATE(..) => GLOBAL_VISION_POSITION_ESTIMATE_DATA::ID,
33670 Self::GPS2_RAW(..) => GPS2_RAW_DATA::ID,
33671 Self::GPS2_RTK(..) => GPS2_RTK_DATA::ID,
33672 Self::GPS_GLOBAL_ORIGIN(..) => GPS_GLOBAL_ORIGIN_DATA::ID,
33673 Self::GPS_INJECT_DATA(..) => GPS_INJECT_DATA_DATA::ID,
33674 Self::GPS_INPUT(..) => GPS_INPUT_DATA::ID,
33675 Self::GPS_RAW_INT(..) => GPS_RAW_INT_DATA::ID,
33676 Self::GPS_RTCM_DATA(..) => GPS_RTCM_DATA_DATA::ID,
33677 Self::GPS_RTK(..) => GPS_RTK_DATA::ID,
33678 Self::GPS_STATUS(..) => GPS_STATUS_DATA::ID,
33679 Self::HEARTBEAT(..) => HEARTBEAT_DATA::ID,
33680 Self::HIGHRES_IMU(..) => HIGHRES_IMU_DATA::ID,
33681 Self::HIGH_LATENCY(..) => HIGH_LATENCY_DATA::ID,
33682 Self::HIGH_LATENCY2(..) => HIGH_LATENCY2_DATA::ID,
33683 Self::HIL_ACTUATOR_CONTROLS(..) => HIL_ACTUATOR_CONTROLS_DATA::ID,
33684 Self::HIL_CONTROLS(..) => HIL_CONTROLS_DATA::ID,
33685 Self::HIL_GPS(..) => HIL_GPS_DATA::ID,
33686 Self::HIL_OPTICAL_FLOW(..) => HIL_OPTICAL_FLOW_DATA::ID,
33687 Self::HIL_RC_INPUTS_RAW(..) => HIL_RC_INPUTS_RAW_DATA::ID,
33688 Self::HIL_SENSOR(..) => HIL_SENSOR_DATA::ID,
33689 Self::HIL_STATE(..) => HIL_STATE_DATA::ID,
33690 Self::HIL_STATE_QUATERNION(..) => HIL_STATE_QUATERNION_DATA::ID,
33691 Self::HOME_POSITION(..) => HOME_POSITION_DATA::ID,
33692 Self::HYGROMETER_SENSOR(..) => HYGROMETER_SENSOR_DATA::ID,
33693 Self::ILLUMINATOR_STATUS(..) => ILLUMINATOR_STATUS_DATA::ID,
33694 Self::ISBD_LINK_STATUS(..) => ISBD_LINK_STATUS_DATA::ID,
33695 Self::LANDING_TARGET(..) => LANDING_TARGET_DATA::ID,
33696 Self::LINK_NODE_STATUS(..) => LINK_NODE_STATUS_DATA::ID,
33697 Self::LOCAL_POSITION_NED(..) => LOCAL_POSITION_NED_DATA::ID,
33698 Self::LOCAL_POSITION_NED_COV(..) => LOCAL_POSITION_NED_COV_DATA::ID,
33699 Self::LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET(..) => {
33700 LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA::ID
33701 }
33702 Self::LOGGING_ACK(..) => LOGGING_ACK_DATA::ID,
33703 Self::LOGGING_DATA(..) => LOGGING_DATA_DATA::ID,
33704 Self::LOGGING_DATA_ACKED(..) => LOGGING_DATA_ACKED_DATA::ID,
33705 Self::LOG_DATA(..) => LOG_DATA_DATA::ID,
33706 Self::LOG_ENTRY(..) => LOG_ENTRY_DATA::ID,
33707 Self::LOG_ERASE(..) => LOG_ERASE_DATA::ID,
33708 Self::LOG_REQUEST_DATA(..) => LOG_REQUEST_DATA_DATA::ID,
33709 Self::LOG_REQUEST_END(..) => LOG_REQUEST_END_DATA::ID,
33710 Self::LOG_REQUEST_LIST(..) => LOG_REQUEST_LIST_DATA::ID,
33711 Self::MAG_CAL_REPORT(..) => MAG_CAL_REPORT_DATA::ID,
33712 Self::MANUAL_CONTROL(..) => MANUAL_CONTROL_DATA::ID,
33713 Self::MANUAL_SETPOINT(..) => MANUAL_SETPOINT_DATA::ID,
33714 Self::MEMORY_VECT(..) => MEMORY_VECT_DATA::ID,
33715 Self::MESSAGE_INTERVAL(..) => MESSAGE_INTERVAL_DATA::ID,
33716 Self::MISSION_ACK(..) => MISSION_ACK_DATA::ID,
33717 Self::MISSION_CLEAR_ALL(..) => MISSION_CLEAR_ALL_DATA::ID,
33718 Self::MISSION_COUNT(..) => MISSION_COUNT_DATA::ID,
33719 Self::MISSION_CURRENT(..) => MISSION_CURRENT_DATA::ID,
33720 Self::MISSION_ITEM(..) => MISSION_ITEM_DATA::ID,
33721 Self::MISSION_ITEM_INT(..) => MISSION_ITEM_INT_DATA::ID,
33722 Self::MISSION_ITEM_REACHED(..) => MISSION_ITEM_REACHED_DATA::ID,
33723 Self::MISSION_REQUEST(..) => MISSION_REQUEST_DATA::ID,
33724 Self::MISSION_REQUEST_INT(..) => MISSION_REQUEST_INT_DATA::ID,
33725 Self::MISSION_REQUEST_LIST(..) => MISSION_REQUEST_LIST_DATA::ID,
33726 Self::MISSION_REQUEST_PARTIAL_LIST(..) => MISSION_REQUEST_PARTIAL_LIST_DATA::ID,
33727 Self::MISSION_SET_CURRENT(..) => MISSION_SET_CURRENT_DATA::ID,
33728 Self::MISSION_WRITE_PARTIAL_LIST(..) => MISSION_WRITE_PARTIAL_LIST_DATA::ID,
33729 Self::MOUNT_ORIENTATION(..) => MOUNT_ORIENTATION_DATA::ID,
33730 Self::NAMED_VALUE_FLOAT(..) => NAMED_VALUE_FLOAT_DATA::ID,
33731 Self::NAMED_VALUE_INT(..) => NAMED_VALUE_INT_DATA::ID,
33732 Self::NAV_CONTROLLER_OUTPUT(..) => NAV_CONTROLLER_OUTPUT_DATA::ID,
33733 Self::OBSTACLE_DISTANCE(..) => OBSTACLE_DISTANCE_DATA::ID,
33734 Self::ODOMETRY(..) => ODOMETRY_DATA::ID,
33735 Self::ONBOARD_COMPUTER_STATUS(..) => ONBOARD_COMPUTER_STATUS_DATA::ID,
33736 Self::OPEN_DRONE_ID_ARM_STATUS(..) => OPEN_DRONE_ID_ARM_STATUS_DATA::ID,
33737 Self::OPEN_DRONE_ID_AUTHENTICATION(..) => OPEN_DRONE_ID_AUTHENTICATION_DATA::ID,
33738 Self::OPEN_DRONE_ID_BASIC_ID(..) => OPEN_DRONE_ID_BASIC_ID_DATA::ID,
33739 Self::OPEN_DRONE_ID_LOCATION(..) => OPEN_DRONE_ID_LOCATION_DATA::ID,
33740 Self::OPEN_DRONE_ID_MESSAGE_PACK(..) => OPEN_DRONE_ID_MESSAGE_PACK_DATA::ID,
33741 Self::OPEN_DRONE_ID_OPERATOR_ID(..) => OPEN_DRONE_ID_OPERATOR_ID_DATA::ID,
33742 Self::OPEN_DRONE_ID_SELF_ID(..) => OPEN_DRONE_ID_SELF_ID_DATA::ID,
33743 Self::OPEN_DRONE_ID_SYSTEM(..) => OPEN_DRONE_ID_SYSTEM_DATA::ID,
33744 Self::OPEN_DRONE_ID_SYSTEM_UPDATE(..) => OPEN_DRONE_ID_SYSTEM_UPDATE_DATA::ID,
33745 Self::OPTICAL_FLOW(..) => OPTICAL_FLOW_DATA::ID,
33746 Self::OPTICAL_FLOW_RAD(..) => OPTICAL_FLOW_RAD_DATA::ID,
33747 Self::ORBIT_EXECUTION_STATUS(..) => ORBIT_EXECUTION_STATUS_DATA::ID,
33748 Self::PARAM_EXT_ACK(..) => PARAM_EXT_ACK_DATA::ID,
33749 Self::PARAM_EXT_REQUEST_LIST(..) => PARAM_EXT_REQUEST_LIST_DATA::ID,
33750 Self::PARAM_EXT_REQUEST_READ(..) => PARAM_EXT_REQUEST_READ_DATA::ID,
33751 Self::PARAM_EXT_SET(..) => PARAM_EXT_SET_DATA::ID,
33752 Self::PARAM_EXT_VALUE(..) => PARAM_EXT_VALUE_DATA::ID,
33753 Self::PARAM_MAP_RC(..) => PARAM_MAP_RC_DATA::ID,
33754 Self::PARAM_REQUEST_LIST(..) => PARAM_REQUEST_LIST_DATA::ID,
33755 Self::PARAM_REQUEST_READ(..) => PARAM_REQUEST_READ_DATA::ID,
33756 Self::PARAM_SET(..) => PARAM_SET_DATA::ID,
33757 Self::PARAM_VALUE(..) => PARAM_VALUE_DATA::ID,
33758 Self::PING(..) => PING_DATA::ID,
33759 Self::PLAY_TUNE(..) => PLAY_TUNE_DATA::ID,
33760 Self::PLAY_TUNE_V2(..) => PLAY_TUNE_V2_DATA::ID,
33761 Self::POSITION_TARGET_GLOBAL_INT(..) => POSITION_TARGET_GLOBAL_INT_DATA::ID,
33762 Self::POSITION_TARGET_LOCAL_NED(..) => POSITION_TARGET_LOCAL_NED_DATA::ID,
33763 Self::POWER_STATUS(..) => POWER_STATUS_DATA::ID,
33764 Self::PROTOCOL_VERSION(..) => PROTOCOL_VERSION_DATA::ID,
33765 Self::RADIO_STATUS(..) => RADIO_STATUS_DATA::ID,
33766 Self::RAW_IMU(..) => RAW_IMU_DATA::ID,
33767 Self::RAW_PRESSURE(..) => RAW_PRESSURE_DATA::ID,
33768 Self::RAW_RPM(..) => RAW_RPM_DATA::ID,
33769 Self::RC_CHANNELS(..) => RC_CHANNELS_DATA::ID,
33770 Self::RC_CHANNELS_OVERRIDE(..) => RC_CHANNELS_OVERRIDE_DATA::ID,
33771 Self::RC_CHANNELS_RAW(..) => RC_CHANNELS_RAW_DATA::ID,
33772 Self::RC_CHANNELS_SCALED(..) => RC_CHANNELS_SCALED_DATA::ID,
33773 Self::REQUEST_DATA_STREAM(..) => REQUEST_DATA_STREAM_DATA::ID,
33774 Self::REQUEST_EVENT(..) => REQUEST_EVENT_DATA::ID,
33775 Self::RESOURCE_REQUEST(..) => RESOURCE_REQUEST_DATA::ID,
33776 Self::RESPONSE_EVENT_ERROR(..) => RESPONSE_EVENT_ERROR_DATA::ID,
33777 Self::SAFETY_ALLOWED_AREA(..) => SAFETY_ALLOWED_AREA_DATA::ID,
33778 Self::SAFETY_SET_ALLOWED_AREA(..) => SAFETY_SET_ALLOWED_AREA_DATA::ID,
33779 Self::SCALED_IMU(..) => SCALED_IMU_DATA::ID,
33780 Self::SCALED_IMU2(..) => SCALED_IMU2_DATA::ID,
33781 Self::SCALED_IMU3(..) => SCALED_IMU3_DATA::ID,
33782 Self::SCALED_PRESSURE(..) => SCALED_PRESSURE_DATA::ID,
33783 Self::SCALED_PRESSURE2(..) => SCALED_PRESSURE2_DATA::ID,
33784 Self::SCALED_PRESSURE3(..) => SCALED_PRESSURE3_DATA::ID,
33785 Self::SERIAL_CONTROL(..) => SERIAL_CONTROL_DATA::ID,
33786 Self::SERVO_OUTPUT_RAW(..) => SERVO_OUTPUT_RAW_DATA::ID,
33787 Self::SETUP_SIGNING(..) => SETUP_SIGNING_DATA::ID,
33788 Self::SET_ACTUATOR_CONTROL_TARGET(..) => SET_ACTUATOR_CONTROL_TARGET_DATA::ID,
33789 Self::SET_ATTITUDE_TARGET(..) => SET_ATTITUDE_TARGET_DATA::ID,
33790 Self::SET_GPS_GLOBAL_ORIGIN(..) => SET_GPS_GLOBAL_ORIGIN_DATA::ID,
33791 Self::SET_HOME_POSITION(..) => SET_HOME_POSITION_DATA::ID,
33792 Self::SET_MODE(..) => SET_MODE_DATA::ID,
33793 Self::SET_POSITION_TARGET_GLOBAL_INT(..) => SET_POSITION_TARGET_GLOBAL_INT_DATA::ID,
33794 Self::SET_POSITION_TARGET_LOCAL_NED(..) => SET_POSITION_TARGET_LOCAL_NED_DATA::ID,
33795 Self::SIM_STATE(..) => SIM_STATE_DATA::ID,
33796 Self::SMART_BATTERY_INFO(..) => SMART_BATTERY_INFO_DATA::ID,
33797 Self::STATUSTEXT(..) => STATUSTEXT_DATA::ID,
33798 Self::STORAGE_INFORMATION(..) => STORAGE_INFORMATION_DATA::ID,
33799 Self::SUPPORTED_TUNES(..) => SUPPORTED_TUNES_DATA::ID,
33800 Self::SYSTEM_TIME(..) => SYSTEM_TIME_DATA::ID,
33801 Self::SYS_STATUS(..) => SYS_STATUS_DATA::ID,
33802 Self::TERRAIN_CHECK(..) => TERRAIN_CHECK_DATA::ID,
33803 Self::TERRAIN_DATA(..) => TERRAIN_DATA_DATA::ID,
33804 Self::TERRAIN_REPORT(..) => TERRAIN_REPORT_DATA::ID,
33805 Self::TERRAIN_REQUEST(..) => TERRAIN_REQUEST_DATA::ID,
33806 Self::TIMESYNC(..) => TIMESYNC_DATA::ID,
33807 Self::TIME_ESTIMATE_TO_TARGET(..) => TIME_ESTIMATE_TO_TARGET_DATA::ID,
33808 Self::TRAJECTORY_REPRESENTATION_BEZIER(..) => TRAJECTORY_REPRESENTATION_BEZIER_DATA::ID,
33809 Self::TRAJECTORY_REPRESENTATION_WAYPOINTS(..) => {
33810 TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA::ID
33811 }
33812 Self::TUNNEL(..) => TUNNEL_DATA::ID,
33813 Self::UAVCAN_NODE_INFO(..) => UAVCAN_NODE_INFO_DATA::ID,
33814 Self::UAVCAN_NODE_STATUS(..) => UAVCAN_NODE_STATUS_DATA::ID,
33815 Self::UTM_GLOBAL_POSITION(..) => UTM_GLOBAL_POSITION_DATA::ID,
33816 Self::V2_EXTENSION(..) => V2_EXTENSION_DATA::ID,
33817 Self::VFR_HUD(..) => VFR_HUD_DATA::ID,
33818 Self::VIBRATION(..) => VIBRATION_DATA::ID,
33819 Self::VICON_POSITION_ESTIMATE(..) => VICON_POSITION_ESTIMATE_DATA::ID,
33820 Self::VIDEO_STREAM_INFORMATION(..) => VIDEO_STREAM_INFORMATION_DATA::ID,
33821 Self::VIDEO_STREAM_STATUS(..) => VIDEO_STREAM_STATUS_DATA::ID,
33822 Self::VISION_POSITION_ESTIMATE(..) => VISION_POSITION_ESTIMATE_DATA::ID,
33823 Self::VISION_SPEED_ESTIMATE(..) => VISION_SPEED_ESTIMATE_DATA::ID,
33824 Self::WHEEL_DISTANCE(..) => WHEEL_DISTANCE_DATA::ID,
33825 Self::WIFI_CONFIG_AP(..) => WIFI_CONFIG_AP_DATA::ID,
33826 Self::WINCH_STATUS(..) => WINCH_STATUS_DATA::ID,
33827 Self::WIND_COV(..) => WIND_COV_DATA::ID,
33828 }
33829 }
33830 fn message_id_from_name(name: &str) -> Option<u32> {
33831 match name {
33832 ACTUATOR_CONTROL_TARGET_DATA::NAME => Some(ACTUATOR_CONTROL_TARGET_DATA::ID),
33833 ACTUATOR_OUTPUT_STATUS_DATA::NAME => Some(ACTUATOR_OUTPUT_STATUS_DATA::ID),
33834 ADSB_VEHICLE_DATA::NAME => Some(ADSB_VEHICLE_DATA::ID),
33835 AIS_VESSEL_DATA::NAME => Some(AIS_VESSEL_DATA::ID),
33836 ALTITUDE_DATA::NAME => Some(ALTITUDE_DATA::ID),
33837 ATTITUDE_DATA::NAME => Some(ATTITUDE_DATA::ID),
33838 ATTITUDE_QUATERNION_DATA::NAME => Some(ATTITUDE_QUATERNION_DATA::ID),
33839 ATTITUDE_QUATERNION_COV_DATA::NAME => Some(ATTITUDE_QUATERNION_COV_DATA::ID),
33840 ATTITUDE_TARGET_DATA::NAME => Some(ATTITUDE_TARGET_DATA::ID),
33841 ATT_POS_MOCAP_DATA::NAME => Some(ATT_POS_MOCAP_DATA::ID),
33842 AUTH_KEY_DATA::NAME => Some(AUTH_KEY_DATA::ID),
33843 AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA::NAME => {
33844 Some(AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA::ID)
33845 }
33846 AUTOPILOT_VERSION_DATA::NAME => Some(AUTOPILOT_VERSION_DATA::ID),
33847 AVAILABLE_MODES_DATA::NAME => Some(AVAILABLE_MODES_DATA::ID),
33848 AVAILABLE_MODES_MONITOR_DATA::NAME => Some(AVAILABLE_MODES_MONITOR_DATA::ID),
33849 AVSS_DRONE_IMU_DATA::NAME => Some(AVSS_DRONE_IMU_DATA::ID),
33850 AVSS_DRONE_OPERATION_MODE_DATA::NAME => Some(AVSS_DRONE_OPERATION_MODE_DATA::ID),
33851 AVSS_DRONE_POSITION_DATA::NAME => Some(AVSS_DRONE_POSITION_DATA::ID),
33852 AVSS_PRS_SYS_STATUS_DATA::NAME => Some(AVSS_PRS_SYS_STATUS_DATA::ID),
33853 BATTERY_INFO_DATA::NAME => Some(BATTERY_INFO_DATA::ID),
33854 BATTERY_STATUS_DATA::NAME => Some(BATTERY_STATUS_DATA::ID),
33855 BUTTON_CHANGE_DATA::NAME => Some(BUTTON_CHANGE_DATA::ID),
33856 CAMERA_CAPTURE_STATUS_DATA::NAME => Some(CAMERA_CAPTURE_STATUS_DATA::ID),
33857 CAMERA_FOV_STATUS_DATA::NAME => Some(CAMERA_FOV_STATUS_DATA::ID),
33858 CAMERA_IMAGE_CAPTURED_DATA::NAME => Some(CAMERA_IMAGE_CAPTURED_DATA::ID),
33859 CAMERA_INFORMATION_DATA::NAME => Some(CAMERA_INFORMATION_DATA::ID),
33860 CAMERA_SETTINGS_DATA::NAME => Some(CAMERA_SETTINGS_DATA::ID),
33861 CAMERA_THERMAL_RANGE_DATA::NAME => Some(CAMERA_THERMAL_RANGE_DATA::ID),
33862 CAMERA_TRACKING_GEO_STATUS_DATA::NAME => Some(CAMERA_TRACKING_GEO_STATUS_DATA::ID),
33863 CAMERA_TRACKING_IMAGE_STATUS_DATA::NAME => Some(CAMERA_TRACKING_IMAGE_STATUS_DATA::ID),
33864 CAMERA_TRIGGER_DATA::NAME => Some(CAMERA_TRIGGER_DATA::ID),
33865 CANFD_FRAME_DATA::NAME => Some(CANFD_FRAME_DATA::ID),
33866 CAN_FILTER_MODIFY_DATA::NAME => Some(CAN_FILTER_MODIFY_DATA::ID),
33867 CAN_FRAME_DATA::NAME => Some(CAN_FRAME_DATA::ID),
33868 CELLULAR_CONFIG_DATA::NAME => Some(CELLULAR_CONFIG_DATA::ID),
33869 CELLULAR_STATUS_DATA::NAME => Some(CELLULAR_STATUS_DATA::ID),
33870 CHANGE_OPERATOR_CONTROL_DATA::NAME => Some(CHANGE_OPERATOR_CONTROL_DATA::ID),
33871 CHANGE_OPERATOR_CONTROL_ACK_DATA::NAME => Some(CHANGE_OPERATOR_CONTROL_ACK_DATA::ID),
33872 COLLISION_DATA::NAME => Some(COLLISION_DATA::ID),
33873 COMMAND_ACK_DATA::NAME => Some(COMMAND_ACK_DATA::ID),
33874 COMMAND_CANCEL_DATA::NAME => Some(COMMAND_CANCEL_DATA::ID),
33875 COMMAND_INT_DATA::NAME => Some(COMMAND_INT_DATA::ID),
33876 COMMAND_LONG_DATA::NAME => Some(COMMAND_LONG_DATA::ID),
33877 COMPONENT_INFORMATION_DATA::NAME => Some(COMPONENT_INFORMATION_DATA::ID),
33878 COMPONENT_INFORMATION_BASIC_DATA::NAME => Some(COMPONENT_INFORMATION_BASIC_DATA::ID),
33879 COMPONENT_METADATA_DATA::NAME => Some(COMPONENT_METADATA_DATA::ID),
33880 CONTROL_SYSTEM_STATE_DATA::NAME => Some(CONTROL_SYSTEM_STATE_DATA::ID),
33881 CURRENT_EVENT_SEQUENCE_DATA::NAME => Some(CURRENT_EVENT_SEQUENCE_DATA::ID),
33882 CURRENT_MODE_DATA::NAME => Some(CURRENT_MODE_DATA::ID),
33883 DATA_STREAM_DATA::NAME => Some(DATA_STREAM_DATA::ID),
33884 DATA_TRANSMISSION_HANDSHAKE_DATA::NAME => Some(DATA_TRANSMISSION_HANDSHAKE_DATA::ID),
33885 DEBUG_DATA::NAME => Some(DEBUG_DATA::ID),
33886 DEBUG_FLOAT_ARRAY_DATA::NAME => Some(DEBUG_FLOAT_ARRAY_DATA::ID),
33887 DEBUG_VECT_DATA::NAME => Some(DEBUG_VECT_DATA::ID),
33888 DISTANCE_SENSOR_DATA::NAME => Some(DISTANCE_SENSOR_DATA::ID),
33889 EFI_STATUS_DATA::NAME => Some(EFI_STATUS_DATA::ID),
33890 ENCAPSULATED_DATA_DATA::NAME => Some(ENCAPSULATED_DATA_DATA::ID),
33891 ESC_INFO_DATA::NAME => Some(ESC_INFO_DATA::ID),
33892 ESC_STATUS_DATA::NAME => Some(ESC_STATUS_DATA::ID),
33893 ESTIMATOR_STATUS_DATA::NAME => Some(ESTIMATOR_STATUS_DATA::ID),
33894 EVENT_DATA::NAME => Some(EVENT_DATA::ID),
33895 EXTENDED_SYS_STATE_DATA::NAME => Some(EXTENDED_SYS_STATE_DATA::ID),
33896 FENCE_STATUS_DATA::NAME => Some(FENCE_STATUS_DATA::ID),
33897 FILE_TRANSFER_PROTOCOL_DATA::NAME => Some(FILE_TRANSFER_PROTOCOL_DATA::ID),
33898 FLIGHT_INFORMATION_DATA::NAME => Some(FLIGHT_INFORMATION_DATA::ID),
33899 FOLLOW_TARGET_DATA::NAME => Some(FOLLOW_TARGET_DATA::ID),
33900 FUEL_STATUS_DATA::NAME => Some(FUEL_STATUS_DATA::ID),
33901 GENERATOR_STATUS_DATA::NAME => Some(GENERATOR_STATUS_DATA::ID),
33902 GIMBAL_DEVICE_ATTITUDE_STATUS_DATA::NAME => {
33903 Some(GIMBAL_DEVICE_ATTITUDE_STATUS_DATA::ID)
33904 }
33905 GIMBAL_DEVICE_INFORMATION_DATA::NAME => Some(GIMBAL_DEVICE_INFORMATION_DATA::ID),
33906 GIMBAL_DEVICE_SET_ATTITUDE_DATA::NAME => Some(GIMBAL_DEVICE_SET_ATTITUDE_DATA::ID),
33907 GIMBAL_MANAGER_INFORMATION_DATA::NAME => Some(GIMBAL_MANAGER_INFORMATION_DATA::ID),
33908 GIMBAL_MANAGER_SET_ATTITUDE_DATA::NAME => Some(GIMBAL_MANAGER_SET_ATTITUDE_DATA::ID),
33909 GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA::NAME => {
33910 Some(GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA::ID)
33911 }
33912 GIMBAL_MANAGER_SET_PITCHYAW_DATA::NAME => Some(GIMBAL_MANAGER_SET_PITCHYAW_DATA::ID),
33913 GIMBAL_MANAGER_STATUS_DATA::NAME => Some(GIMBAL_MANAGER_STATUS_DATA::ID),
33914 GLOBAL_POSITION_INT_DATA::NAME => Some(GLOBAL_POSITION_INT_DATA::ID),
33915 GLOBAL_POSITION_INT_COV_DATA::NAME => Some(GLOBAL_POSITION_INT_COV_DATA::ID),
33916 GLOBAL_VISION_POSITION_ESTIMATE_DATA::NAME => {
33917 Some(GLOBAL_VISION_POSITION_ESTIMATE_DATA::ID)
33918 }
33919 GPS2_RAW_DATA::NAME => Some(GPS2_RAW_DATA::ID),
33920 GPS2_RTK_DATA::NAME => Some(GPS2_RTK_DATA::ID),
33921 GPS_GLOBAL_ORIGIN_DATA::NAME => Some(GPS_GLOBAL_ORIGIN_DATA::ID),
33922 GPS_INJECT_DATA_DATA::NAME => Some(GPS_INJECT_DATA_DATA::ID),
33923 GPS_INPUT_DATA::NAME => Some(GPS_INPUT_DATA::ID),
33924 GPS_RAW_INT_DATA::NAME => Some(GPS_RAW_INT_DATA::ID),
33925 GPS_RTCM_DATA_DATA::NAME => Some(GPS_RTCM_DATA_DATA::ID),
33926 GPS_RTK_DATA::NAME => Some(GPS_RTK_DATA::ID),
33927 GPS_STATUS_DATA::NAME => Some(GPS_STATUS_DATA::ID),
33928 HEARTBEAT_DATA::NAME => Some(HEARTBEAT_DATA::ID),
33929 HIGHRES_IMU_DATA::NAME => Some(HIGHRES_IMU_DATA::ID),
33930 HIGH_LATENCY_DATA::NAME => Some(HIGH_LATENCY_DATA::ID),
33931 HIGH_LATENCY2_DATA::NAME => Some(HIGH_LATENCY2_DATA::ID),
33932 HIL_ACTUATOR_CONTROLS_DATA::NAME => Some(HIL_ACTUATOR_CONTROLS_DATA::ID),
33933 HIL_CONTROLS_DATA::NAME => Some(HIL_CONTROLS_DATA::ID),
33934 HIL_GPS_DATA::NAME => Some(HIL_GPS_DATA::ID),
33935 HIL_OPTICAL_FLOW_DATA::NAME => Some(HIL_OPTICAL_FLOW_DATA::ID),
33936 HIL_RC_INPUTS_RAW_DATA::NAME => Some(HIL_RC_INPUTS_RAW_DATA::ID),
33937 HIL_SENSOR_DATA::NAME => Some(HIL_SENSOR_DATA::ID),
33938 HIL_STATE_DATA::NAME => Some(HIL_STATE_DATA::ID),
33939 HIL_STATE_QUATERNION_DATA::NAME => Some(HIL_STATE_QUATERNION_DATA::ID),
33940 HOME_POSITION_DATA::NAME => Some(HOME_POSITION_DATA::ID),
33941 HYGROMETER_SENSOR_DATA::NAME => Some(HYGROMETER_SENSOR_DATA::ID),
33942 ILLUMINATOR_STATUS_DATA::NAME => Some(ILLUMINATOR_STATUS_DATA::ID),
33943 ISBD_LINK_STATUS_DATA::NAME => Some(ISBD_LINK_STATUS_DATA::ID),
33944 LANDING_TARGET_DATA::NAME => Some(LANDING_TARGET_DATA::ID),
33945 LINK_NODE_STATUS_DATA::NAME => Some(LINK_NODE_STATUS_DATA::ID),
33946 LOCAL_POSITION_NED_DATA::NAME => Some(LOCAL_POSITION_NED_DATA::ID),
33947 LOCAL_POSITION_NED_COV_DATA::NAME => Some(LOCAL_POSITION_NED_COV_DATA::ID),
33948 LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA::NAME => {
33949 Some(LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA::ID)
33950 }
33951 LOGGING_ACK_DATA::NAME => Some(LOGGING_ACK_DATA::ID),
33952 LOGGING_DATA_DATA::NAME => Some(LOGGING_DATA_DATA::ID),
33953 LOGGING_DATA_ACKED_DATA::NAME => Some(LOGGING_DATA_ACKED_DATA::ID),
33954 LOG_DATA_DATA::NAME => Some(LOG_DATA_DATA::ID),
33955 LOG_ENTRY_DATA::NAME => Some(LOG_ENTRY_DATA::ID),
33956 LOG_ERASE_DATA::NAME => Some(LOG_ERASE_DATA::ID),
33957 LOG_REQUEST_DATA_DATA::NAME => Some(LOG_REQUEST_DATA_DATA::ID),
33958 LOG_REQUEST_END_DATA::NAME => Some(LOG_REQUEST_END_DATA::ID),
33959 LOG_REQUEST_LIST_DATA::NAME => Some(LOG_REQUEST_LIST_DATA::ID),
33960 MAG_CAL_REPORT_DATA::NAME => Some(MAG_CAL_REPORT_DATA::ID),
33961 MANUAL_CONTROL_DATA::NAME => Some(MANUAL_CONTROL_DATA::ID),
33962 MANUAL_SETPOINT_DATA::NAME => Some(MANUAL_SETPOINT_DATA::ID),
33963 MEMORY_VECT_DATA::NAME => Some(MEMORY_VECT_DATA::ID),
33964 MESSAGE_INTERVAL_DATA::NAME => Some(MESSAGE_INTERVAL_DATA::ID),
33965 MISSION_ACK_DATA::NAME => Some(MISSION_ACK_DATA::ID),
33966 MISSION_CLEAR_ALL_DATA::NAME => Some(MISSION_CLEAR_ALL_DATA::ID),
33967 MISSION_COUNT_DATA::NAME => Some(MISSION_COUNT_DATA::ID),
33968 MISSION_CURRENT_DATA::NAME => Some(MISSION_CURRENT_DATA::ID),
33969 MISSION_ITEM_DATA::NAME => Some(MISSION_ITEM_DATA::ID),
33970 MISSION_ITEM_INT_DATA::NAME => Some(MISSION_ITEM_INT_DATA::ID),
33971 MISSION_ITEM_REACHED_DATA::NAME => Some(MISSION_ITEM_REACHED_DATA::ID),
33972 MISSION_REQUEST_DATA::NAME => Some(MISSION_REQUEST_DATA::ID),
33973 MISSION_REQUEST_INT_DATA::NAME => Some(MISSION_REQUEST_INT_DATA::ID),
33974 MISSION_REQUEST_LIST_DATA::NAME => Some(MISSION_REQUEST_LIST_DATA::ID),
33975 MISSION_REQUEST_PARTIAL_LIST_DATA::NAME => Some(MISSION_REQUEST_PARTIAL_LIST_DATA::ID),
33976 MISSION_SET_CURRENT_DATA::NAME => Some(MISSION_SET_CURRENT_DATA::ID),
33977 MISSION_WRITE_PARTIAL_LIST_DATA::NAME => Some(MISSION_WRITE_PARTIAL_LIST_DATA::ID),
33978 MOUNT_ORIENTATION_DATA::NAME => Some(MOUNT_ORIENTATION_DATA::ID),
33979 NAMED_VALUE_FLOAT_DATA::NAME => Some(NAMED_VALUE_FLOAT_DATA::ID),
33980 NAMED_VALUE_INT_DATA::NAME => Some(NAMED_VALUE_INT_DATA::ID),
33981 NAV_CONTROLLER_OUTPUT_DATA::NAME => Some(NAV_CONTROLLER_OUTPUT_DATA::ID),
33982 OBSTACLE_DISTANCE_DATA::NAME => Some(OBSTACLE_DISTANCE_DATA::ID),
33983 ODOMETRY_DATA::NAME => Some(ODOMETRY_DATA::ID),
33984 ONBOARD_COMPUTER_STATUS_DATA::NAME => Some(ONBOARD_COMPUTER_STATUS_DATA::ID),
33985 OPEN_DRONE_ID_ARM_STATUS_DATA::NAME => Some(OPEN_DRONE_ID_ARM_STATUS_DATA::ID),
33986 OPEN_DRONE_ID_AUTHENTICATION_DATA::NAME => Some(OPEN_DRONE_ID_AUTHENTICATION_DATA::ID),
33987 OPEN_DRONE_ID_BASIC_ID_DATA::NAME => Some(OPEN_DRONE_ID_BASIC_ID_DATA::ID),
33988 OPEN_DRONE_ID_LOCATION_DATA::NAME => Some(OPEN_DRONE_ID_LOCATION_DATA::ID),
33989 OPEN_DRONE_ID_MESSAGE_PACK_DATA::NAME => Some(OPEN_DRONE_ID_MESSAGE_PACK_DATA::ID),
33990 OPEN_DRONE_ID_OPERATOR_ID_DATA::NAME => Some(OPEN_DRONE_ID_OPERATOR_ID_DATA::ID),
33991 OPEN_DRONE_ID_SELF_ID_DATA::NAME => Some(OPEN_DRONE_ID_SELF_ID_DATA::ID),
33992 OPEN_DRONE_ID_SYSTEM_DATA::NAME => Some(OPEN_DRONE_ID_SYSTEM_DATA::ID),
33993 OPEN_DRONE_ID_SYSTEM_UPDATE_DATA::NAME => Some(OPEN_DRONE_ID_SYSTEM_UPDATE_DATA::ID),
33994 OPTICAL_FLOW_DATA::NAME => Some(OPTICAL_FLOW_DATA::ID),
33995 OPTICAL_FLOW_RAD_DATA::NAME => Some(OPTICAL_FLOW_RAD_DATA::ID),
33996 ORBIT_EXECUTION_STATUS_DATA::NAME => Some(ORBIT_EXECUTION_STATUS_DATA::ID),
33997 PARAM_EXT_ACK_DATA::NAME => Some(PARAM_EXT_ACK_DATA::ID),
33998 PARAM_EXT_REQUEST_LIST_DATA::NAME => Some(PARAM_EXT_REQUEST_LIST_DATA::ID),
33999 PARAM_EXT_REQUEST_READ_DATA::NAME => Some(PARAM_EXT_REQUEST_READ_DATA::ID),
34000 PARAM_EXT_SET_DATA::NAME => Some(PARAM_EXT_SET_DATA::ID),
34001 PARAM_EXT_VALUE_DATA::NAME => Some(PARAM_EXT_VALUE_DATA::ID),
34002 PARAM_MAP_RC_DATA::NAME => Some(PARAM_MAP_RC_DATA::ID),
34003 PARAM_REQUEST_LIST_DATA::NAME => Some(PARAM_REQUEST_LIST_DATA::ID),
34004 PARAM_REQUEST_READ_DATA::NAME => Some(PARAM_REQUEST_READ_DATA::ID),
34005 PARAM_SET_DATA::NAME => Some(PARAM_SET_DATA::ID),
34006 PARAM_VALUE_DATA::NAME => Some(PARAM_VALUE_DATA::ID),
34007 PING_DATA::NAME => Some(PING_DATA::ID),
34008 PLAY_TUNE_DATA::NAME => Some(PLAY_TUNE_DATA::ID),
34009 PLAY_TUNE_V2_DATA::NAME => Some(PLAY_TUNE_V2_DATA::ID),
34010 POSITION_TARGET_GLOBAL_INT_DATA::NAME => Some(POSITION_TARGET_GLOBAL_INT_DATA::ID),
34011 POSITION_TARGET_LOCAL_NED_DATA::NAME => Some(POSITION_TARGET_LOCAL_NED_DATA::ID),
34012 POWER_STATUS_DATA::NAME => Some(POWER_STATUS_DATA::ID),
34013 PROTOCOL_VERSION_DATA::NAME => Some(PROTOCOL_VERSION_DATA::ID),
34014 RADIO_STATUS_DATA::NAME => Some(RADIO_STATUS_DATA::ID),
34015 RAW_IMU_DATA::NAME => Some(RAW_IMU_DATA::ID),
34016 RAW_PRESSURE_DATA::NAME => Some(RAW_PRESSURE_DATA::ID),
34017 RAW_RPM_DATA::NAME => Some(RAW_RPM_DATA::ID),
34018 RC_CHANNELS_DATA::NAME => Some(RC_CHANNELS_DATA::ID),
34019 RC_CHANNELS_OVERRIDE_DATA::NAME => Some(RC_CHANNELS_OVERRIDE_DATA::ID),
34020 RC_CHANNELS_RAW_DATA::NAME => Some(RC_CHANNELS_RAW_DATA::ID),
34021 RC_CHANNELS_SCALED_DATA::NAME => Some(RC_CHANNELS_SCALED_DATA::ID),
34022 REQUEST_DATA_STREAM_DATA::NAME => Some(REQUEST_DATA_STREAM_DATA::ID),
34023 REQUEST_EVENT_DATA::NAME => Some(REQUEST_EVENT_DATA::ID),
34024 RESOURCE_REQUEST_DATA::NAME => Some(RESOURCE_REQUEST_DATA::ID),
34025 RESPONSE_EVENT_ERROR_DATA::NAME => Some(RESPONSE_EVENT_ERROR_DATA::ID),
34026 SAFETY_ALLOWED_AREA_DATA::NAME => Some(SAFETY_ALLOWED_AREA_DATA::ID),
34027 SAFETY_SET_ALLOWED_AREA_DATA::NAME => Some(SAFETY_SET_ALLOWED_AREA_DATA::ID),
34028 SCALED_IMU_DATA::NAME => Some(SCALED_IMU_DATA::ID),
34029 SCALED_IMU2_DATA::NAME => Some(SCALED_IMU2_DATA::ID),
34030 SCALED_IMU3_DATA::NAME => Some(SCALED_IMU3_DATA::ID),
34031 SCALED_PRESSURE_DATA::NAME => Some(SCALED_PRESSURE_DATA::ID),
34032 SCALED_PRESSURE2_DATA::NAME => Some(SCALED_PRESSURE2_DATA::ID),
34033 SCALED_PRESSURE3_DATA::NAME => Some(SCALED_PRESSURE3_DATA::ID),
34034 SERIAL_CONTROL_DATA::NAME => Some(SERIAL_CONTROL_DATA::ID),
34035 SERVO_OUTPUT_RAW_DATA::NAME => Some(SERVO_OUTPUT_RAW_DATA::ID),
34036 SETUP_SIGNING_DATA::NAME => Some(SETUP_SIGNING_DATA::ID),
34037 SET_ACTUATOR_CONTROL_TARGET_DATA::NAME => Some(SET_ACTUATOR_CONTROL_TARGET_DATA::ID),
34038 SET_ATTITUDE_TARGET_DATA::NAME => Some(SET_ATTITUDE_TARGET_DATA::ID),
34039 SET_GPS_GLOBAL_ORIGIN_DATA::NAME => Some(SET_GPS_GLOBAL_ORIGIN_DATA::ID),
34040 SET_HOME_POSITION_DATA::NAME => Some(SET_HOME_POSITION_DATA::ID),
34041 SET_MODE_DATA::NAME => Some(SET_MODE_DATA::ID),
34042 SET_POSITION_TARGET_GLOBAL_INT_DATA::NAME => {
34043 Some(SET_POSITION_TARGET_GLOBAL_INT_DATA::ID)
34044 }
34045 SET_POSITION_TARGET_LOCAL_NED_DATA::NAME => {
34046 Some(SET_POSITION_TARGET_LOCAL_NED_DATA::ID)
34047 }
34048 SIM_STATE_DATA::NAME => Some(SIM_STATE_DATA::ID),
34049 SMART_BATTERY_INFO_DATA::NAME => Some(SMART_BATTERY_INFO_DATA::ID),
34050 STATUSTEXT_DATA::NAME => Some(STATUSTEXT_DATA::ID),
34051 STORAGE_INFORMATION_DATA::NAME => Some(STORAGE_INFORMATION_DATA::ID),
34052 SUPPORTED_TUNES_DATA::NAME => Some(SUPPORTED_TUNES_DATA::ID),
34053 SYSTEM_TIME_DATA::NAME => Some(SYSTEM_TIME_DATA::ID),
34054 SYS_STATUS_DATA::NAME => Some(SYS_STATUS_DATA::ID),
34055 TERRAIN_CHECK_DATA::NAME => Some(TERRAIN_CHECK_DATA::ID),
34056 TERRAIN_DATA_DATA::NAME => Some(TERRAIN_DATA_DATA::ID),
34057 TERRAIN_REPORT_DATA::NAME => Some(TERRAIN_REPORT_DATA::ID),
34058 TERRAIN_REQUEST_DATA::NAME => Some(TERRAIN_REQUEST_DATA::ID),
34059 TIMESYNC_DATA::NAME => Some(TIMESYNC_DATA::ID),
34060 TIME_ESTIMATE_TO_TARGET_DATA::NAME => Some(TIME_ESTIMATE_TO_TARGET_DATA::ID),
34061 TRAJECTORY_REPRESENTATION_BEZIER_DATA::NAME => {
34062 Some(TRAJECTORY_REPRESENTATION_BEZIER_DATA::ID)
34063 }
34064 TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA::NAME => {
34065 Some(TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA::ID)
34066 }
34067 TUNNEL_DATA::NAME => Some(TUNNEL_DATA::ID),
34068 UAVCAN_NODE_INFO_DATA::NAME => Some(UAVCAN_NODE_INFO_DATA::ID),
34069 UAVCAN_NODE_STATUS_DATA::NAME => Some(UAVCAN_NODE_STATUS_DATA::ID),
34070 UTM_GLOBAL_POSITION_DATA::NAME => Some(UTM_GLOBAL_POSITION_DATA::ID),
34071 V2_EXTENSION_DATA::NAME => Some(V2_EXTENSION_DATA::ID),
34072 VFR_HUD_DATA::NAME => Some(VFR_HUD_DATA::ID),
34073 VIBRATION_DATA::NAME => Some(VIBRATION_DATA::ID),
34074 VICON_POSITION_ESTIMATE_DATA::NAME => Some(VICON_POSITION_ESTIMATE_DATA::ID),
34075 VIDEO_STREAM_INFORMATION_DATA::NAME => Some(VIDEO_STREAM_INFORMATION_DATA::ID),
34076 VIDEO_STREAM_STATUS_DATA::NAME => Some(VIDEO_STREAM_STATUS_DATA::ID),
34077 VISION_POSITION_ESTIMATE_DATA::NAME => Some(VISION_POSITION_ESTIMATE_DATA::ID),
34078 VISION_SPEED_ESTIMATE_DATA::NAME => Some(VISION_SPEED_ESTIMATE_DATA::ID),
34079 WHEEL_DISTANCE_DATA::NAME => Some(WHEEL_DISTANCE_DATA::ID),
34080 WIFI_CONFIG_AP_DATA::NAME => Some(WIFI_CONFIG_AP_DATA::ID),
34081 WINCH_STATUS_DATA::NAME => Some(WINCH_STATUS_DATA::ID),
34082 WIND_COV_DATA::NAME => Some(WIND_COV_DATA::ID),
34083 _ => None,
34084 }
34085 }
34086 fn default_message_from_id(id: u32) -> Option<Self> {
34087 match id {
34088 ACTUATOR_CONTROL_TARGET_DATA::ID => Some(Self::ACTUATOR_CONTROL_TARGET(
34089 ACTUATOR_CONTROL_TARGET_DATA::default(),
34090 )),
34091 ACTUATOR_OUTPUT_STATUS_DATA::ID => Some(Self::ACTUATOR_OUTPUT_STATUS(
34092 ACTUATOR_OUTPUT_STATUS_DATA::default(),
34093 )),
34094 ADSB_VEHICLE_DATA::ID => Some(Self::ADSB_VEHICLE(ADSB_VEHICLE_DATA::default())),
34095 AIS_VESSEL_DATA::ID => Some(Self::AIS_VESSEL(AIS_VESSEL_DATA::default())),
34096 ALTITUDE_DATA::ID => Some(Self::ALTITUDE(ALTITUDE_DATA::default())),
34097 ATTITUDE_DATA::ID => Some(Self::ATTITUDE(ATTITUDE_DATA::default())),
34098 ATTITUDE_QUATERNION_DATA::ID => Some(Self::ATTITUDE_QUATERNION(
34099 ATTITUDE_QUATERNION_DATA::default(),
34100 )),
34101 ATTITUDE_QUATERNION_COV_DATA::ID => Some(Self::ATTITUDE_QUATERNION_COV(
34102 ATTITUDE_QUATERNION_COV_DATA::default(),
34103 )),
34104 ATTITUDE_TARGET_DATA::ID => {
34105 Some(Self::ATTITUDE_TARGET(ATTITUDE_TARGET_DATA::default()))
34106 }
34107 ATT_POS_MOCAP_DATA::ID => Some(Self::ATT_POS_MOCAP(ATT_POS_MOCAP_DATA::default())),
34108 AUTH_KEY_DATA::ID => Some(Self::AUTH_KEY(AUTH_KEY_DATA::default())),
34109 AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA::ID => {
34110 Some(Self::AUTOPILOT_STATE_FOR_GIMBAL_DEVICE(
34111 AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA::default(),
34112 ))
34113 }
34114 AUTOPILOT_VERSION_DATA::ID => {
34115 Some(Self::AUTOPILOT_VERSION(AUTOPILOT_VERSION_DATA::default()))
34116 }
34117 AVAILABLE_MODES_DATA::ID => {
34118 Some(Self::AVAILABLE_MODES(AVAILABLE_MODES_DATA::default()))
34119 }
34120 AVAILABLE_MODES_MONITOR_DATA::ID => Some(Self::AVAILABLE_MODES_MONITOR(
34121 AVAILABLE_MODES_MONITOR_DATA::default(),
34122 )),
34123 AVSS_DRONE_IMU_DATA::ID => Some(Self::AVSS_DRONE_IMU(AVSS_DRONE_IMU_DATA::default())),
34124 AVSS_DRONE_OPERATION_MODE_DATA::ID => Some(Self::AVSS_DRONE_OPERATION_MODE(
34125 AVSS_DRONE_OPERATION_MODE_DATA::default(),
34126 )),
34127 AVSS_DRONE_POSITION_DATA::ID => Some(Self::AVSS_DRONE_POSITION(
34128 AVSS_DRONE_POSITION_DATA::default(),
34129 )),
34130 AVSS_PRS_SYS_STATUS_DATA::ID => Some(Self::AVSS_PRS_SYS_STATUS(
34131 AVSS_PRS_SYS_STATUS_DATA::default(),
34132 )),
34133 BATTERY_INFO_DATA::ID => Some(Self::BATTERY_INFO(BATTERY_INFO_DATA::default())),
34134 BATTERY_STATUS_DATA::ID => Some(Self::BATTERY_STATUS(BATTERY_STATUS_DATA::default())),
34135 BUTTON_CHANGE_DATA::ID => Some(Self::BUTTON_CHANGE(BUTTON_CHANGE_DATA::default())),
34136 CAMERA_CAPTURE_STATUS_DATA::ID => Some(Self::CAMERA_CAPTURE_STATUS(
34137 CAMERA_CAPTURE_STATUS_DATA::default(),
34138 )),
34139 CAMERA_FOV_STATUS_DATA::ID => {
34140 Some(Self::CAMERA_FOV_STATUS(CAMERA_FOV_STATUS_DATA::default()))
34141 }
34142 CAMERA_IMAGE_CAPTURED_DATA::ID => Some(Self::CAMERA_IMAGE_CAPTURED(
34143 CAMERA_IMAGE_CAPTURED_DATA::default(),
34144 )),
34145 CAMERA_INFORMATION_DATA::ID => {
34146 Some(Self::CAMERA_INFORMATION(CAMERA_INFORMATION_DATA::default()))
34147 }
34148 CAMERA_SETTINGS_DATA::ID => {
34149 Some(Self::CAMERA_SETTINGS(CAMERA_SETTINGS_DATA::default()))
34150 }
34151 CAMERA_THERMAL_RANGE_DATA::ID => Some(Self::CAMERA_THERMAL_RANGE(
34152 CAMERA_THERMAL_RANGE_DATA::default(),
34153 )),
34154 CAMERA_TRACKING_GEO_STATUS_DATA::ID => Some(Self::CAMERA_TRACKING_GEO_STATUS(
34155 CAMERA_TRACKING_GEO_STATUS_DATA::default(),
34156 )),
34157 CAMERA_TRACKING_IMAGE_STATUS_DATA::ID => Some(Self::CAMERA_TRACKING_IMAGE_STATUS(
34158 CAMERA_TRACKING_IMAGE_STATUS_DATA::default(),
34159 )),
34160 CAMERA_TRIGGER_DATA::ID => Some(Self::CAMERA_TRIGGER(CAMERA_TRIGGER_DATA::default())),
34161 CANFD_FRAME_DATA::ID => Some(Self::CANFD_FRAME(CANFD_FRAME_DATA::default())),
34162 CAN_FILTER_MODIFY_DATA::ID => {
34163 Some(Self::CAN_FILTER_MODIFY(CAN_FILTER_MODIFY_DATA::default()))
34164 }
34165 CAN_FRAME_DATA::ID => Some(Self::CAN_FRAME(CAN_FRAME_DATA::default())),
34166 CELLULAR_CONFIG_DATA::ID => {
34167 Some(Self::CELLULAR_CONFIG(CELLULAR_CONFIG_DATA::default()))
34168 }
34169 CELLULAR_STATUS_DATA::ID => {
34170 Some(Self::CELLULAR_STATUS(CELLULAR_STATUS_DATA::default()))
34171 }
34172 CHANGE_OPERATOR_CONTROL_DATA::ID => Some(Self::CHANGE_OPERATOR_CONTROL(
34173 CHANGE_OPERATOR_CONTROL_DATA::default(),
34174 )),
34175 CHANGE_OPERATOR_CONTROL_ACK_DATA::ID => Some(Self::CHANGE_OPERATOR_CONTROL_ACK(
34176 CHANGE_OPERATOR_CONTROL_ACK_DATA::default(),
34177 )),
34178 COLLISION_DATA::ID => Some(Self::COLLISION(COLLISION_DATA::default())),
34179 COMMAND_ACK_DATA::ID => Some(Self::COMMAND_ACK(COMMAND_ACK_DATA::default())),
34180 COMMAND_CANCEL_DATA::ID => Some(Self::COMMAND_CANCEL(COMMAND_CANCEL_DATA::default())),
34181 COMMAND_INT_DATA::ID => Some(Self::COMMAND_INT(COMMAND_INT_DATA::default())),
34182 COMMAND_LONG_DATA::ID => Some(Self::COMMAND_LONG(COMMAND_LONG_DATA::default())),
34183 COMPONENT_INFORMATION_DATA::ID => Some(Self::COMPONENT_INFORMATION(
34184 COMPONENT_INFORMATION_DATA::default(),
34185 )),
34186 COMPONENT_INFORMATION_BASIC_DATA::ID => Some(Self::COMPONENT_INFORMATION_BASIC(
34187 COMPONENT_INFORMATION_BASIC_DATA::default(),
34188 )),
34189 COMPONENT_METADATA_DATA::ID => {
34190 Some(Self::COMPONENT_METADATA(COMPONENT_METADATA_DATA::default()))
34191 }
34192 CONTROL_SYSTEM_STATE_DATA::ID => Some(Self::CONTROL_SYSTEM_STATE(
34193 CONTROL_SYSTEM_STATE_DATA::default(),
34194 )),
34195 CURRENT_EVENT_SEQUENCE_DATA::ID => Some(Self::CURRENT_EVENT_SEQUENCE(
34196 CURRENT_EVENT_SEQUENCE_DATA::default(),
34197 )),
34198 CURRENT_MODE_DATA::ID => Some(Self::CURRENT_MODE(CURRENT_MODE_DATA::default())),
34199 DATA_STREAM_DATA::ID => Some(Self::DATA_STREAM(DATA_STREAM_DATA::default())),
34200 DATA_TRANSMISSION_HANDSHAKE_DATA::ID => Some(Self::DATA_TRANSMISSION_HANDSHAKE(
34201 DATA_TRANSMISSION_HANDSHAKE_DATA::default(),
34202 )),
34203 DEBUG_DATA::ID => Some(Self::DEBUG(DEBUG_DATA::default())),
34204 DEBUG_FLOAT_ARRAY_DATA::ID => {
34205 Some(Self::DEBUG_FLOAT_ARRAY(DEBUG_FLOAT_ARRAY_DATA::default()))
34206 }
34207 DEBUG_VECT_DATA::ID => Some(Self::DEBUG_VECT(DEBUG_VECT_DATA::default())),
34208 DISTANCE_SENSOR_DATA::ID => {
34209 Some(Self::DISTANCE_SENSOR(DISTANCE_SENSOR_DATA::default()))
34210 }
34211 EFI_STATUS_DATA::ID => Some(Self::EFI_STATUS(EFI_STATUS_DATA::default())),
34212 ENCAPSULATED_DATA_DATA::ID => {
34213 Some(Self::ENCAPSULATED_DATA(ENCAPSULATED_DATA_DATA::default()))
34214 }
34215 ESC_INFO_DATA::ID => Some(Self::ESC_INFO(ESC_INFO_DATA::default())),
34216 ESC_STATUS_DATA::ID => Some(Self::ESC_STATUS(ESC_STATUS_DATA::default())),
34217 ESTIMATOR_STATUS_DATA::ID => {
34218 Some(Self::ESTIMATOR_STATUS(ESTIMATOR_STATUS_DATA::default()))
34219 }
34220 EVENT_DATA::ID => Some(Self::EVENT(EVENT_DATA::default())),
34221 EXTENDED_SYS_STATE_DATA::ID => {
34222 Some(Self::EXTENDED_SYS_STATE(EXTENDED_SYS_STATE_DATA::default()))
34223 }
34224 FENCE_STATUS_DATA::ID => Some(Self::FENCE_STATUS(FENCE_STATUS_DATA::default())),
34225 FILE_TRANSFER_PROTOCOL_DATA::ID => Some(Self::FILE_TRANSFER_PROTOCOL(
34226 FILE_TRANSFER_PROTOCOL_DATA::default(),
34227 )),
34228 FLIGHT_INFORMATION_DATA::ID => {
34229 Some(Self::FLIGHT_INFORMATION(FLIGHT_INFORMATION_DATA::default()))
34230 }
34231 FOLLOW_TARGET_DATA::ID => Some(Self::FOLLOW_TARGET(FOLLOW_TARGET_DATA::default())),
34232 FUEL_STATUS_DATA::ID => Some(Self::FUEL_STATUS(FUEL_STATUS_DATA::default())),
34233 GENERATOR_STATUS_DATA::ID => {
34234 Some(Self::GENERATOR_STATUS(GENERATOR_STATUS_DATA::default()))
34235 }
34236 GIMBAL_DEVICE_ATTITUDE_STATUS_DATA::ID => Some(Self::GIMBAL_DEVICE_ATTITUDE_STATUS(
34237 GIMBAL_DEVICE_ATTITUDE_STATUS_DATA::default(),
34238 )),
34239 GIMBAL_DEVICE_INFORMATION_DATA::ID => Some(Self::GIMBAL_DEVICE_INFORMATION(
34240 GIMBAL_DEVICE_INFORMATION_DATA::default(),
34241 )),
34242 GIMBAL_DEVICE_SET_ATTITUDE_DATA::ID => Some(Self::GIMBAL_DEVICE_SET_ATTITUDE(
34243 GIMBAL_DEVICE_SET_ATTITUDE_DATA::default(),
34244 )),
34245 GIMBAL_MANAGER_INFORMATION_DATA::ID => Some(Self::GIMBAL_MANAGER_INFORMATION(
34246 GIMBAL_MANAGER_INFORMATION_DATA::default(),
34247 )),
34248 GIMBAL_MANAGER_SET_ATTITUDE_DATA::ID => Some(Self::GIMBAL_MANAGER_SET_ATTITUDE(
34249 GIMBAL_MANAGER_SET_ATTITUDE_DATA::default(),
34250 )),
34251 GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA::ID => {
34252 Some(Self::GIMBAL_MANAGER_SET_MANUAL_CONTROL(
34253 GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA::default(),
34254 ))
34255 }
34256 GIMBAL_MANAGER_SET_PITCHYAW_DATA::ID => Some(Self::GIMBAL_MANAGER_SET_PITCHYAW(
34257 GIMBAL_MANAGER_SET_PITCHYAW_DATA::default(),
34258 )),
34259 GIMBAL_MANAGER_STATUS_DATA::ID => Some(Self::GIMBAL_MANAGER_STATUS(
34260 GIMBAL_MANAGER_STATUS_DATA::default(),
34261 )),
34262 GLOBAL_POSITION_INT_DATA::ID => Some(Self::GLOBAL_POSITION_INT(
34263 GLOBAL_POSITION_INT_DATA::default(),
34264 )),
34265 GLOBAL_POSITION_INT_COV_DATA::ID => Some(Self::GLOBAL_POSITION_INT_COV(
34266 GLOBAL_POSITION_INT_COV_DATA::default(),
34267 )),
34268 GLOBAL_VISION_POSITION_ESTIMATE_DATA::ID => {
34269 Some(Self::GLOBAL_VISION_POSITION_ESTIMATE(
34270 GLOBAL_VISION_POSITION_ESTIMATE_DATA::default(),
34271 ))
34272 }
34273 GPS2_RAW_DATA::ID => Some(Self::GPS2_RAW(GPS2_RAW_DATA::default())),
34274 GPS2_RTK_DATA::ID => Some(Self::GPS2_RTK(GPS2_RTK_DATA::default())),
34275 GPS_GLOBAL_ORIGIN_DATA::ID => {
34276 Some(Self::GPS_GLOBAL_ORIGIN(GPS_GLOBAL_ORIGIN_DATA::default()))
34277 }
34278 GPS_INJECT_DATA_DATA::ID => {
34279 Some(Self::GPS_INJECT_DATA(GPS_INJECT_DATA_DATA::default()))
34280 }
34281 GPS_INPUT_DATA::ID => Some(Self::GPS_INPUT(GPS_INPUT_DATA::default())),
34282 GPS_RAW_INT_DATA::ID => Some(Self::GPS_RAW_INT(GPS_RAW_INT_DATA::default())),
34283 GPS_RTCM_DATA_DATA::ID => Some(Self::GPS_RTCM_DATA(GPS_RTCM_DATA_DATA::default())),
34284 GPS_RTK_DATA::ID => Some(Self::GPS_RTK(GPS_RTK_DATA::default())),
34285 GPS_STATUS_DATA::ID => Some(Self::GPS_STATUS(GPS_STATUS_DATA::default())),
34286 HEARTBEAT_DATA::ID => Some(Self::HEARTBEAT(HEARTBEAT_DATA::default())),
34287 HIGHRES_IMU_DATA::ID => Some(Self::HIGHRES_IMU(HIGHRES_IMU_DATA::default())),
34288 HIGH_LATENCY_DATA::ID => Some(Self::HIGH_LATENCY(HIGH_LATENCY_DATA::default())),
34289 HIGH_LATENCY2_DATA::ID => Some(Self::HIGH_LATENCY2(HIGH_LATENCY2_DATA::default())),
34290 HIL_ACTUATOR_CONTROLS_DATA::ID => Some(Self::HIL_ACTUATOR_CONTROLS(
34291 HIL_ACTUATOR_CONTROLS_DATA::default(),
34292 )),
34293 HIL_CONTROLS_DATA::ID => Some(Self::HIL_CONTROLS(HIL_CONTROLS_DATA::default())),
34294 HIL_GPS_DATA::ID => Some(Self::HIL_GPS(HIL_GPS_DATA::default())),
34295 HIL_OPTICAL_FLOW_DATA::ID => {
34296 Some(Self::HIL_OPTICAL_FLOW(HIL_OPTICAL_FLOW_DATA::default()))
34297 }
34298 HIL_RC_INPUTS_RAW_DATA::ID => {
34299 Some(Self::HIL_RC_INPUTS_RAW(HIL_RC_INPUTS_RAW_DATA::default()))
34300 }
34301 HIL_SENSOR_DATA::ID => Some(Self::HIL_SENSOR(HIL_SENSOR_DATA::default())),
34302 HIL_STATE_DATA::ID => Some(Self::HIL_STATE(HIL_STATE_DATA::default())),
34303 HIL_STATE_QUATERNION_DATA::ID => Some(Self::HIL_STATE_QUATERNION(
34304 HIL_STATE_QUATERNION_DATA::default(),
34305 )),
34306 HOME_POSITION_DATA::ID => Some(Self::HOME_POSITION(HOME_POSITION_DATA::default())),
34307 HYGROMETER_SENSOR_DATA::ID => {
34308 Some(Self::HYGROMETER_SENSOR(HYGROMETER_SENSOR_DATA::default()))
34309 }
34310 ILLUMINATOR_STATUS_DATA::ID => {
34311 Some(Self::ILLUMINATOR_STATUS(ILLUMINATOR_STATUS_DATA::default()))
34312 }
34313 ISBD_LINK_STATUS_DATA::ID => {
34314 Some(Self::ISBD_LINK_STATUS(ISBD_LINK_STATUS_DATA::default()))
34315 }
34316 LANDING_TARGET_DATA::ID => Some(Self::LANDING_TARGET(LANDING_TARGET_DATA::default())),
34317 LINK_NODE_STATUS_DATA::ID => {
34318 Some(Self::LINK_NODE_STATUS(LINK_NODE_STATUS_DATA::default()))
34319 }
34320 LOCAL_POSITION_NED_DATA::ID => {
34321 Some(Self::LOCAL_POSITION_NED(LOCAL_POSITION_NED_DATA::default()))
34322 }
34323 LOCAL_POSITION_NED_COV_DATA::ID => Some(Self::LOCAL_POSITION_NED_COV(
34324 LOCAL_POSITION_NED_COV_DATA::default(),
34325 )),
34326 LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA::ID => {
34327 Some(Self::LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET(
34328 LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA::default(),
34329 ))
34330 }
34331 LOGGING_ACK_DATA::ID => Some(Self::LOGGING_ACK(LOGGING_ACK_DATA::default())),
34332 LOGGING_DATA_DATA::ID => Some(Self::LOGGING_DATA(LOGGING_DATA_DATA::default())),
34333 LOGGING_DATA_ACKED_DATA::ID => {
34334 Some(Self::LOGGING_DATA_ACKED(LOGGING_DATA_ACKED_DATA::default()))
34335 }
34336 LOG_DATA_DATA::ID => Some(Self::LOG_DATA(LOG_DATA_DATA::default())),
34337 LOG_ENTRY_DATA::ID => Some(Self::LOG_ENTRY(LOG_ENTRY_DATA::default())),
34338 LOG_ERASE_DATA::ID => Some(Self::LOG_ERASE(LOG_ERASE_DATA::default())),
34339 LOG_REQUEST_DATA_DATA::ID => {
34340 Some(Self::LOG_REQUEST_DATA(LOG_REQUEST_DATA_DATA::default()))
34341 }
34342 LOG_REQUEST_END_DATA::ID => {
34343 Some(Self::LOG_REQUEST_END(LOG_REQUEST_END_DATA::default()))
34344 }
34345 LOG_REQUEST_LIST_DATA::ID => {
34346 Some(Self::LOG_REQUEST_LIST(LOG_REQUEST_LIST_DATA::default()))
34347 }
34348 MAG_CAL_REPORT_DATA::ID => Some(Self::MAG_CAL_REPORT(MAG_CAL_REPORT_DATA::default())),
34349 MANUAL_CONTROL_DATA::ID => Some(Self::MANUAL_CONTROL(MANUAL_CONTROL_DATA::default())),
34350 MANUAL_SETPOINT_DATA::ID => {
34351 Some(Self::MANUAL_SETPOINT(MANUAL_SETPOINT_DATA::default()))
34352 }
34353 MEMORY_VECT_DATA::ID => Some(Self::MEMORY_VECT(MEMORY_VECT_DATA::default())),
34354 MESSAGE_INTERVAL_DATA::ID => {
34355 Some(Self::MESSAGE_INTERVAL(MESSAGE_INTERVAL_DATA::default()))
34356 }
34357 MISSION_ACK_DATA::ID => Some(Self::MISSION_ACK(MISSION_ACK_DATA::default())),
34358 MISSION_CLEAR_ALL_DATA::ID => {
34359 Some(Self::MISSION_CLEAR_ALL(MISSION_CLEAR_ALL_DATA::default()))
34360 }
34361 MISSION_COUNT_DATA::ID => Some(Self::MISSION_COUNT(MISSION_COUNT_DATA::default())),
34362 MISSION_CURRENT_DATA::ID => {
34363 Some(Self::MISSION_CURRENT(MISSION_CURRENT_DATA::default()))
34364 }
34365 MISSION_ITEM_DATA::ID => Some(Self::MISSION_ITEM(MISSION_ITEM_DATA::default())),
34366 MISSION_ITEM_INT_DATA::ID => {
34367 Some(Self::MISSION_ITEM_INT(MISSION_ITEM_INT_DATA::default()))
34368 }
34369 MISSION_ITEM_REACHED_DATA::ID => Some(Self::MISSION_ITEM_REACHED(
34370 MISSION_ITEM_REACHED_DATA::default(),
34371 )),
34372 MISSION_REQUEST_DATA::ID => {
34373 Some(Self::MISSION_REQUEST(MISSION_REQUEST_DATA::default()))
34374 }
34375 MISSION_REQUEST_INT_DATA::ID => Some(Self::MISSION_REQUEST_INT(
34376 MISSION_REQUEST_INT_DATA::default(),
34377 )),
34378 MISSION_REQUEST_LIST_DATA::ID => Some(Self::MISSION_REQUEST_LIST(
34379 MISSION_REQUEST_LIST_DATA::default(),
34380 )),
34381 MISSION_REQUEST_PARTIAL_LIST_DATA::ID => Some(Self::MISSION_REQUEST_PARTIAL_LIST(
34382 MISSION_REQUEST_PARTIAL_LIST_DATA::default(),
34383 )),
34384 MISSION_SET_CURRENT_DATA::ID => Some(Self::MISSION_SET_CURRENT(
34385 MISSION_SET_CURRENT_DATA::default(),
34386 )),
34387 MISSION_WRITE_PARTIAL_LIST_DATA::ID => Some(Self::MISSION_WRITE_PARTIAL_LIST(
34388 MISSION_WRITE_PARTIAL_LIST_DATA::default(),
34389 )),
34390 MOUNT_ORIENTATION_DATA::ID => {
34391 Some(Self::MOUNT_ORIENTATION(MOUNT_ORIENTATION_DATA::default()))
34392 }
34393 NAMED_VALUE_FLOAT_DATA::ID => {
34394 Some(Self::NAMED_VALUE_FLOAT(NAMED_VALUE_FLOAT_DATA::default()))
34395 }
34396 NAMED_VALUE_INT_DATA::ID => {
34397 Some(Self::NAMED_VALUE_INT(NAMED_VALUE_INT_DATA::default()))
34398 }
34399 NAV_CONTROLLER_OUTPUT_DATA::ID => Some(Self::NAV_CONTROLLER_OUTPUT(
34400 NAV_CONTROLLER_OUTPUT_DATA::default(),
34401 )),
34402 OBSTACLE_DISTANCE_DATA::ID => {
34403 Some(Self::OBSTACLE_DISTANCE(OBSTACLE_DISTANCE_DATA::default()))
34404 }
34405 ODOMETRY_DATA::ID => Some(Self::ODOMETRY(ODOMETRY_DATA::default())),
34406 ONBOARD_COMPUTER_STATUS_DATA::ID => Some(Self::ONBOARD_COMPUTER_STATUS(
34407 ONBOARD_COMPUTER_STATUS_DATA::default(),
34408 )),
34409 OPEN_DRONE_ID_ARM_STATUS_DATA::ID => Some(Self::OPEN_DRONE_ID_ARM_STATUS(
34410 OPEN_DRONE_ID_ARM_STATUS_DATA::default(),
34411 )),
34412 OPEN_DRONE_ID_AUTHENTICATION_DATA::ID => Some(Self::OPEN_DRONE_ID_AUTHENTICATION(
34413 OPEN_DRONE_ID_AUTHENTICATION_DATA::default(),
34414 )),
34415 OPEN_DRONE_ID_BASIC_ID_DATA::ID => Some(Self::OPEN_DRONE_ID_BASIC_ID(
34416 OPEN_DRONE_ID_BASIC_ID_DATA::default(),
34417 )),
34418 OPEN_DRONE_ID_LOCATION_DATA::ID => Some(Self::OPEN_DRONE_ID_LOCATION(
34419 OPEN_DRONE_ID_LOCATION_DATA::default(),
34420 )),
34421 OPEN_DRONE_ID_MESSAGE_PACK_DATA::ID => Some(Self::OPEN_DRONE_ID_MESSAGE_PACK(
34422 OPEN_DRONE_ID_MESSAGE_PACK_DATA::default(),
34423 )),
34424 OPEN_DRONE_ID_OPERATOR_ID_DATA::ID => Some(Self::OPEN_DRONE_ID_OPERATOR_ID(
34425 OPEN_DRONE_ID_OPERATOR_ID_DATA::default(),
34426 )),
34427 OPEN_DRONE_ID_SELF_ID_DATA::ID => Some(Self::OPEN_DRONE_ID_SELF_ID(
34428 OPEN_DRONE_ID_SELF_ID_DATA::default(),
34429 )),
34430 OPEN_DRONE_ID_SYSTEM_DATA::ID => Some(Self::OPEN_DRONE_ID_SYSTEM(
34431 OPEN_DRONE_ID_SYSTEM_DATA::default(),
34432 )),
34433 OPEN_DRONE_ID_SYSTEM_UPDATE_DATA::ID => Some(Self::OPEN_DRONE_ID_SYSTEM_UPDATE(
34434 OPEN_DRONE_ID_SYSTEM_UPDATE_DATA::default(),
34435 )),
34436 OPTICAL_FLOW_DATA::ID => Some(Self::OPTICAL_FLOW(OPTICAL_FLOW_DATA::default())),
34437 OPTICAL_FLOW_RAD_DATA::ID => {
34438 Some(Self::OPTICAL_FLOW_RAD(OPTICAL_FLOW_RAD_DATA::default()))
34439 }
34440 ORBIT_EXECUTION_STATUS_DATA::ID => Some(Self::ORBIT_EXECUTION_STATUS(
34441 ORBIT_EXECUTION_STATUS_DATA::default(),
34442 )),
34443 PARAM_EXT_ACK_DATA::ID => Some(Self::PARAM_EXT_ACK(PARAM_EXT_ACK_DATA::default())),
34444 PARAM_EXT_REQUEST_LIST_DATA::ID => Some(Self::PARAM_EXT_REQUEST_LIST(
34445 PARAM_EXT_REQUEST_LIST_DATA::default(),
34446 )),
34447 PARAM_EXT_REQUEST_READ_DATA::ID => Some(Self::PARAM_EXT_REQUEST_READ(
34448 PARAM_EXT_REQUEST_READ_DATA::default(),
34449 )),
34450 PARAM_EXT_SET_DATA::ID => Some(Self::PARAM_EXT_SET(PARAM_EXT_SET_DATA::default())),
34451 PARAM_EXT_VALUE_DATA::ID => {
34452 Some(Self::PARAM_EXT_VALUE(PARAM_EXT_VALUE_DATA::default()))
34453 }
34454 PARAM_MAP_RC_DATA::ID => Some(Self::PARAM_MAP_RC(PARAM_MAP_RC_DATA::default())),
34455 PARAM_REQUEST_LIST_DATA::ID => {
34456 Some(Self::PARAM_REQUEST_LIST(PARAM_REQUEST_LIST_DATA::default()))
34457 }
34458 PARAM_REQUEST_READ_DATA::ID => {
34459 Some(Self::PARAM_REQUEST_READ(PARAM_REQUEST_READ_DATA::default()))
34460 }
34461 PARAM_SET_DATA::ID => Some(Self::PARAM_SET(PARAM_SET_DATA::default())),
34462 PARAM_VALUE_DATA::ID => Some(Self::PARAM_VALUE(PARAM_VALUE_DATA::default())),
34463 PING_DATA::ID => Some(Self::PING(PING_DATA::default())),
34464 PLAY_TUNE_DATA::ID => Some(Self::PLAY_TUNE(PLAY_TUNE_DATA::default())),
34465 PLAY_TUNE_V2_DATA::ID => Some(Self::PLAY_TUNE_V2(PLAY_TUNE_V2_DATA::default())),
34466 POSITION_TARGET_GLOBAL_INT_DATA::ID => Some(Self::POSITION_TARGET_GLOBAL_INT(
34467 POSITION_TARGET_GLOBAL_INT_DATA::default(),
34468 )),
34469 POSITION_TARGET_LOCAL_NED_DATA::ID => Some(Self::POSITION_TARGET_LOCAL_NED(
34470 POSITION_TARGET_LOCAL_NED_DATA::default(),
34471 )),
34472 POWER_STATUS_DATA::ID => Some(Self::POWER_STATUS(POWER_STATUS_DATA::default())),
34473 PROTOCOL_VERSION_DATA::ID => {
34474 Some(Self::PROTOCOL_VERSION(PROTOCOL_VERSION_DATA::default()))
34475 }
34476 RADIO_STATUS_DATA::ID => Some(Self::RADIO_STATUS(RADIO_STATUS_DATA::default())),
34477 RAW_IMU_DATA::ID => Some(Self::RAW_IMU(RAW_IMU_DATA::default())),
34478 RAW_PRESSURE_DATA::ID => Some(Self::RAW_PRESSURE(RAW_PRESSURE_DATA::default())),
34479 RAW_RPM_DATA::ID => Some(Self::RAW_RPM(RAW_RPM_DATA::default())),
34480 RC_CHANNELS_DATA::ID => Some(Self::RC_CHANNELS(RC_CHANNELS_DATA::default())),
34481 RC_CHANNELS_OVERRIDE_DATA::ID => Some(Self::RC_CHANNELS_OVERRIDE(
34482 RC_CHANNELS_OVERRIDE_DATA::default(),
34483 )),
34484 RC_CHANNELS_RAW_DATA::ID => {
34485 Some(Self::RC_CHANNELS_RAW(RC_CHANNELS_RAW_DATA::default()))
34486 }
34487 RC_CHANNELS_SCALED_DATA::ID => {
34488 Some(Self::RC_CHANNELS_SCALED(RC_CHANNELS_SCALED_DATA::default()))
34489 }
34490 REQUEST_DATA_STREAM_DATA::ID => Some(Self::REQUEST_DATA_STREAM(
34491 REQUEST_DATA_STREAM_DATA::default(),
34492 )),
34493 REQUEST_EVENT_DATA::ID => Some(Self::REQUEST_EVENT(REQUEST_EVENT_DATA::default())),
34494 RESOURCE_REQUEST_DATA::ID => {
34495 Some(Self::RESOURCE_REQUEST(RESOURCE_REQUEST_DATA::default()))
34496 }
34497 RESPONSE_EVENT_ERROR_DATA::ID => Some(Self::RESPONSE_EVENT_ERROR(
34498 RESPONSE_EVENT_ERROR_DATA::default(),
34499 )),
34500 SAFETY_ALLOWED_AREA_DATA::ID => Some(Self::SAFETY_ALLOWED_AREA(
34501 SAFETY_ALLOWED_AREA_DATA::default(),
34502 )),
34503 SAFETY_SET_ALLOWED_AREA_DATA::ID => Some(Self::SAFETY_SET_ALLOWED_AREA(
34504 SAFETY_SET_ALLOWED_AREA_DATA::default(),
34505 )),
34506 SCALED_IMU_DATA::ID => Some(Self::SCALED_IMU(SCALED_IMU_DATA::default())),
34507 SCALED_IMU2_DATA::ID => Some(Self::SCALED_IMU2(SCALED_IMU2_DATA::default())),
34508 SCALED_IMU3_DATA::ID => Some(Self::SCALED_IMU3(SCALED_IMU3_DATA::default())),
34509 SCALED_PRESSURE_DATA::ID => {
34510 Some(Self::SCALED_PRESSURE(SCALED_PRESSURE_DATA::default()))
34511 }
34512 SCALED_PRESSURE2_DATA::ID => {
34513 Some(Self::SCALED_PRESSURE2(SCALED_PRESSURE2_DATA::default()))
34514 }
34515 SCALED_PRESSURE3_DATA::ID => {
34516 Some(Self::SCALED_PRESSURE3(SCALED_PRESSURE3_DATA::default()))
34517 }
34518 SERIAL_CONTROL_DATA::ID => Some(Self::SERIAL_CONTROL(SERIAL_CONTROL_DATA::default())),
34519 SERVO_OUTPUT_RAW_DATA::ID => {
34520 Some(Self::SERVO_OUTPUT_RAW(SERVO_OUTPUT_RAW_DATA::default()))
34521 }
34522 SETUP_SIGNING_DATA::ID => Some(Self::SETUP_SIGNING(SETUP_SIGNING_DATA::default())),
34523 SET_ACTUATOR_CONTROL_TARGET_DATA::ID => Some(Self::SET_ACTUATOR_CONTROL_TARGET(
34524 SET_ACTUATOR_CONTROL_TARGET_DATA::default(),
34525 )),
34526 SET_ATTITUDE_TARGET_DATA::ID => Some(Self::SET_ATTITUDE_TARGET(
34527 SET_ATTITUDE_TARGET_DATA::default(),
34528 )),
34529 SET_GPS_GLOBAL_ORIGIN_DATA::ID => Some(Self::SET_GPS_GLOBAL_ORIGIN(
34530 SET_GPS_GLOBAL_ORIGIN_DATA::default(),
34531 )),
34532 SET_HOME_POSITION_DATA::ID => {
34533 Some(Self::SET_HOME_POSITION(SET_HOME_POSITION_DATA::default()))
34534 }
34535 SET_MODE_DATA::ID => Some(Self::SET_MODE(SET_MODE_DATA::default())),
34536 SET_POSITION_TARGET_GLOBAL_INT_DATA::ID => Some(Self::SET_POSITION_TARGET_GLOBAL_INT(
34537 SET_POSITION_TARGET_GLOBAL_INT_DATA::default(),
34538 )),
34539 SET_POSITION_TARGET_LOCAL_NED_DATA::ID => Some(Self::SET_POSITION_TARGET_LOCAL_NED(
34540 SET_POSITION_TARGET_LOCAL_NED_DATA::default(),
34541 )),
34542 SIM_STATE_DATA::ID => Some(Self::SIM_STATE(SIM_STATE_DATA::default())),
34543 SMART_BATTERY_INFO_DATA::ID => {
34544 Some(Self::SMART_BATTERY_INFO(SMART_BATTERY_INFO_DATA::default()))
34545 }
34546 STATUSTEXT_DATA::ID => Some(Self::STATUSTEXT(STATUSTEXT_DATA::default())),
34547 STORAGE_INFORMATION_DATA::ID => Some(Self::STORAGE_INFORMATION(
34548 STORAGE_INFORMATION_DATA::default(),
34549 )),
34550 SUPPORTED_TUNES_DATA::ID => {
34551 Some(Self::SUPPORTED_TUNES(SUPPORTED_TUNES_DATA::default()))
34552 }
34553 SYSTEM_TIME_DATA::ID => Some(Self::SYSTEM_TIME(SYSTEM_TIME_DATA::default())),
34554 SYS_STATUS_DATA::ID => Some(Self::SYS_STATUS(SYS_STATUS_DATA::default())),
34555 TERRAIN_CHECK_DATA::ID => Some(Self::TERRAIN_CHECK(TERRAIN_CHECK_DATA::default())),
34556 TERRAIN_DATA_DATA::ID => Some(Self::TERRAIN_DATA(TERRAIN_DATA_DATA::default())),
34557 TERRAIN_REPORT_DATA::ID => Some(Self::TERRAIN_REPORT(TERRAIN_REPORT_DATA::default())),
34558 TERRAIN_REQUEST_DATA::ID => {
34559 Some(Self::TERRAIN_REQUEST(TERRAIN_REQUEST_DATA::default()))
34560 }
34561 TIMESYNC_DATA::ID => Some(Self::TIMESYNC(TIMESYNC_DATA::default())),
34562 TIME_ESTIMATE_TO_TARGET_DATA::ID => Some(Self::TIME_ESTIMATE_TO_TARGET(
34563 TIME_ESTIMATE_TO_TARGET_DATA::default(),
34564 )),
34565 TRAJECTORY_REPRESENTATION_BEZIER_DATA::ID => {
34566 Some(Self::TRAJECTORY_REPRESENTATION_BEZIER(
34567 TRAJECTORY_REPRESENTATION_BEZIER_DATA::default(),
34568 ))
34569 }
34570 TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA::ID => {
34571 Some(Self::TRAJECTORY_REPRESENTATION_WAYPOINTS(
34572 TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA::default(),
34573 ))
34574 }
34575 TUNNEL_DATA::ID => Some(Self::TUNNEL(TUNNEL_DATA::default())),
34576 UAVCAN_NODE_INFO_DATA::ID => {
34577 Some(Self::UAVCAN_NODE_INFO(UAVCAN_NODE_INFO_DATA::default()))
34578 }
34579 UAVCAN_NODE_STATUS_DATA::ID => {
34580 Some(Self::UAVCAN_NODE_STATUS(UAVCAN_NODE_STATUS_DATA::default()))
34581 }
34582 UTM_GLOBAL_POSITION_DATA::ID => Some(Self::UTM_GLOBAL_POSITION(
34583 UTM_GLOBAL_POSITION_DATA::default(),
34584 )),
34585 V2_EXTENSION_DATA::ID => Some(Self::V2_EXTENSION(V2_EXTENSION_DATA::default())),
34586 VFR_HUD_DATA::ID => Some(Self::VFR_HUD(VFR_HUD_DATA::default())),
34587 VIBRATION_DATA::ID => Some(Self::VIBRATION(VIBRATION_DATA::default())),
34588 VICON_POSITION_ESTIMATE_DATA::ID => Some(Self::VICON_POSITION_ESTIMATE(
34589 VICON_POSITION_ESTIMATE_DATA::default(),
34590 )),
34591 VIDEO_STREAM_INFORMATION_DATA::ID => Some(Self::VIDEO_STREAM_INFORMATION(
34592 VIDEO_STREAM_INFORMATION_DATA::default(),
34593 )),
34594 VIDEO_STREAM_STATUS_DATA::ID => Some(Self::VIDEO_STREAM_STATUS(
34595 VIDEO_STREAM_STATUS_DATA::default(),
34596 )),
34597 VISION_POSITION_ESTIMATE_DATA::ID => Some(Self::VISION_POSITION_ESTIMATE(
34598 VISION_POSITION_ESTIMATE_DATA::default(),
34599 )),
34600 VISION_SPEED_ESTIMATE_DATA::ID => Some(Self::VISION_SPEED_ESTIMATE(
34601 VISION_SPEED_ESTIMATE_DATA::default(),
34602 )),
34603 WHEEL_DISTANCE_DATA::ID => Some(Self::WHEEL_DISTANCE(WHEEL_DISTANCE_DATA::default())),
34604 WIFI_CONFIG_AP_DATA::ID => Some(Self::WIFI_CONFIG_AP(WIFI_CONFIG_AP_DATA::default())),
34605 WINCH_STATUS_DATA::ID => Some(Self::WINCH_STATUS(WINCH_STATUS_DATA::default())),
34606 WIND_COV_DATA::ID => Some(Self::WIND_COV(WIND_COV_DATA::default())),
34607 _ => None,
34608 }
34609 }
34610 #[cfg(feature = "arbitrary")]
34611 fn random_message_from_id<R: rand::RngCore>(id: u32, rng: &mut R) -> Option<Self> {
34612 match id {
34613 ACTUATOR_CONTROL_TARGET_DATA::ID => Some(Self::ACTUATOR_CONTROL_TARGET(
34614 ACTUATOR_CONTROL_TARGET_DATA::random(rng),
34615 )),
34616 ACTUATOR_OUTPUT_STATUS_DATA::ID => Some(Self::ACTUATOR_OUTPUT_STATUS(
34617 ACTUATOR_OUTPUT_STATUS_DATA::random(rng),
34618 )),
34619 ADSB_VEHICLE_DATA::ID => Some(Self::ADSB_VEHICLE(ADSB_VEHICLE_DATA::random(rng))),
34620 AIS_VESSEL_DATA::ID => Some(Self::AIS_VESSEL(AIS_VESSEL_DATA::random(rng))),
34621 ALTITUDE_DATA::ID => Some(Self::ALTITUDE(ALTITUDE_DATA::random(rng))),
34622 ATTITUDE_DATA::ID => Some(Self::ATTITUDE(ATTITUDE_DATA::random(rng))),
34623 ATTITUDE_QUATERNION_DATA::ID => Some(Self::ATTITUDE_QUATERNION(
34624 ATTITUDE_QUATERNION_DATA::random(rng),
34625 )),
34626 ATTITUDE_QUATERNION_COV_DATA::ID => Some(Self::ATTITUDE_QUATERNION_COV(
34627 ATTITUDE_QUATERNION_COV_DATA::random(rng),
34628 )),
34629 ATTITUDE_TARGET_DATA::ID => {
34630 Some(Self::ATTITUDE_TARGET(ATTITUDE_TARGET_DATA::random(rng)))
34631 }
34632 ATT_POS_MOCAP_DATA::ID => Some(Self::ATT_POS_MOCAP(ATT_POS_MOCAP_DATA::random(rng))),
34633 AUTH_KEY_DATA::ID => Some(Self::AUTH_KEY(AUTH_KEY_DATA::random(rng))),
34634 AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA::ID => {
34635 Some(Self::AUTOPILOT_STATE_FOR_GIMBAL_DEVICE(
34636 AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA::random(rng),
34637 ))
34638 }
34639 AUTOPILOT_VERSION_DATA::ID => {
34640 Some(Self::AUTOPILOT_VERSION(AUTOPILOT_VERSION_DATA::random(rng)))
34641 }
34642 AVAILABLE_MODES_DATA::ID => {
34643 Some(Self::AVAILABLE_MODES(AVAILABLE_MODES_DATA::random(rng)))
34644 }
34645 AVAILABLE_MODES_MONITOR_DATA::ID => Some(Self::AVAILABLE_MODES_MONITOR(
34646 AVAILABLE_MODES_MONITOR_DATA::random(rng),
34647 )),
34648 AVSS_DRONE_IMU_DATA::ID => Some(Self::AVSS_DRONE_IMU(AVSS_DRONE_IMU_DATA::random(rng))),
34649 AVSS_DRONE_OPERATION_MODE_DATA::ID => Some(Self::AVSS_DRONE_OPERATION_MODE(
34650 AVSS_DRONE_OPERATION_MODE_DATA::random(rng),
34651 )),
34652 AVSS_DRONE_POSITION_DATA::ID => Some(Self::AVSS_DRONE_POSITION(
34653 AVSS_DRONE_POSITION_DATA::random(rng),
34654 )),
34655 AVSS_PRS_SYS_STATUS_DATA::ID => Some(Self::AVSS_PRS_SYS_STATUS(
34656 AVSS_PRS_SYS_STATUS_DATA::random(rng),
34657 )),
34658 BATTERY_INFO_DATA::ID => Some(Self::BATTERY_INFO(BATTERY_INFO_DATA::random(rng))),
34659 BATTERY_STATUS_DATA::ID => Some(Self::BATTERY_STATUS(BATTERY_STATUS_DATA::random(rng))),
34660 BUTTON_CHANGE_DATA::ID => Some(Self::BUTTON_CHANGE(BUTTON_CHANGE_DATA::random(rng))),
34661 CAMERA_CAPTURE_STATUS_DATA::ID => Some(Self::CAMERA_CAPTURE_STATUS(
34662 CAMERA_CAPTURE_STATUS_DATA::random(rng),
34663 )),
34664 CAMERA_FOV_STATUS_DATA::ID => {
34665 Some(Self::CAMERA_FOV_STATUS(CAMERA_FOV_STATUS_DATA::random(rng)))
34666 }
34667 CAMERA_IMAGE_CAPTURED_DATA::ID => Some(Self::CAMERA_IMAGE_CAPTURED(
34668 CAMERA_IMAGE_CAPTURED_DATA::random(rng),
34669 )),
34670 CAMERA_INFORMATION_DATA::ID => Some(Self::CAMERA_INFORMATION(
34671 CAMERA_INFORMATION_DATA::random(rng),
34672 )),
34673 CAMERA_SETTINGS_DATA::ID => {
34674 Some(Self::CAMERA_SETTINGS(CAMERA_SETTINGS_DATA::random(rng)))
34675 }
34676 CAMERA_THERMAL_RANGE_DATA::ID => Some(Self::CAMERA_THERMAL_RANGE(
34677 CAMERA_THERMAL_RANGE_DATA::random(rng),
34678 )),
34679 CAMERA_TRACKING_GEO_STATUS_DATA::ID => Some(Self::CAMERA_TRACKING_GEO_STATUS(
34680 CAMERA_TRACKING_GEO_STATUS_DATA::random(rng),
34681 )),
34682 CAMERA_TRACKING_IMAGE_STATUS_DATA::ID => Some(Self::CAMERA_TRACKING_IMAGE_STATUS(
34683 CAMERA_TRACKING_IMAGE_STATUS_DATA::random(rng),
34684 )),
34685 CAMERA_TRIGGER_DATA::ID => Some(Self::CAMERA_TRIGGER(CAMERA_TRIGGER_DATA::random(rng))),
34686 CANFD_FRAME_DATA::ID => Some(Self::CANFD_FRAME(CANFD_FRAME_DATA::random(rng))),
34687 CAN_FILTER_MODIFY_DATA::ID => {
34688 Some(Self::CAN_FILTER_MODIFY(CAN_FILTER_MODIFY_DATA::random(rng)))
34689 }
34690 CAN_FRAME_DATA::ID => Some(Self::CAN_FRAME(CAN_FRAME_DATA::random(rng))),
34691 CELLULAR_CONFIG_DATA::ID => {
34692 Some(Self::CELLULAR_CONFIG(CELLULAR_CONFIG_DATA::random(rng)))
34693 }
34694 CELLULAR_STATUS_DATA::ID => {
34695 Some(Self::CELLULAR_STATUS(CELLULAR_STATUS_DATA::random(rng)))
34696 }
34697 CHANGE_OPERATOR_CONTROL_DATA::ID => Some(Self::CHANGE_OPERATOR_CONTROL(
34698 CHANGE_OPERATOR_CONTROL_DATA::random(rng),
34699 )),
34700 CHANGE_OPERATOR_CONTROL_ACK_DATA::ID => Some(Self::CHANGE_OPERATOR_CONTROL_ACK(
34701 CHANGE_OPERATOR_CONTROL_ACK_DATA::random(rng),
34702 )),
34703 COLLISION_DATA::ID => Some(Self::COLLISION(COLLISION_DATA::random(rng))),
34704 COMMAND_ACK_DATA::ID => Some(Self::COMMAND_ACK(COMMAND_ACK_DATA::random(rng))),
34705 COMMAND_CANCEL_DATA::ID => Some(Self::COMMAND_CANCEL(COMMAND_CANCEL_DATA::random(rng))),
34706 COMMAND_INT_DATA::ID => Some(Self::COMMAND_INT(COMMAND_INT_DATA::random(rng))),
34707 COMMAND_LONG_DATA::ID => Some(Self::COMMAND_LONG(COMMAND_LONG_DATA::random(rng))),
34708 COMPONENT_INFORMATION_DATA::ID => Some(Self::COMPONENT_INFORMATION(
34709 COMPONENT_INFORMATION_DATA::random(rng),
34710 )),
34711 COMPONENT_INFORMATION_BASIC_DATA::ID => Some(Self::COMPONENT_INFORMATION_BASIC(
34712 COMPONENT_INFORMATION_BASIC_DATA::random(rng),
34713 )),
34714 COMPONENT_METADATA_DATA::ID => Some(Self::COMPONENT_METADATA(
34715 COMPONENT_METADATA_DATA::random(rng),
34716 )),
34717 CONTROL_SYSTEM_STATE_DATA::ID => Some(Self::CONTROL_SYSTEM_STATE(
34718 CONTROL_SYSTEM_STATE_DATA::random(rng),
34719 )),
34720 CURRENT_EVENT_SEQUENCE_DATA::ID => Some(Self::CURRENT_EVENT_SEQUENCE(
34721 CURRENT_EVENT_SEQUENCE_DATA::random(rng),
34722 )),
34723 CURRENT_MODE_DATA::ID => Some(Self::CURRENT_MODE(CURRENT_MODE_DATA::random(rng))),
34724 DATA_STREAM_DATA::ID => Some(Self::DATA_STREAM(DATA_STREAM_DATA::random(rng))),
34725 DATA_TRANSMISSION_HANDSHAKE_DATA::ID => Some(Self::DATA_TRANSMISSION_HANDSHAKE(
34726 DATA_TRANSMISSION_HANDSHAKE_DATA::random(rng),
34727 )),
34728 DEBUG_DATA::ID => Some(Self::DEBUG(DEBUG_DATA::random(rng))),
34729 DEBUG_FLOAT_ARRAY_DATA::ID => {
34730 Some(Self::DEBUG_FLOAT_ARRAY(DEBUG_FLOAT_ARRAY_DATA::random(rng)))
34731 }
34732 DEBUG_VECT_DATA::ID => Some(Self::DEBUG_VECT(DEBUG_VECT_DATA::random(rng))),
34733 DISTANCE_SENSOR_DATA::ID => {
34734 Some(Self::DISTANCE_SENSOR(DISTANCE_SENSOR_DATA::random(rng)))
34735 }
34736 EFI_STATUS_DATA::ID => Some(Self::EFI_STATUS(EFI_STATUS_DATA::random(rng))),
34737 ENCAPSULATED_DATA_DATA::ID => {
34738 Some(Self::ENCAPSULATED_DATA(ENCAPSULATED_DATA_DATA::random(rng)))
34739 }
34740 ESC_INFO_DATA::ID => Some(Self::ESC_INFO(ESC_INFO_DATA::random(rng))),
34741 ESC_STATUS_DATA::ID => Some(Self::ESC_STATUS(ESC_STATUS_DATA::random(rng))),
34742 ESTIMATOR_STATUS_DATA::ID => {
34743 Some(Self::ESTIMATOR_STATUS(ESTIMATOR_STATUS_DATA::random(rng)))
34744 }
34745 EVENT_DATA::ID => Some(Self::EVENT(EVENT_DATA::random(rng))),
34746 EXTENDED_SYS_STATE_DATA::ID => Some(Self::EXTENDED_SYS_STATE(
34747 EXTENDED_SYS_STATE_DATA::random(rng),
34748 )),
34749 FENCE_STATUS_DATA::ID => Some(Self::FENCE_STATUS(FENCE_STATUS_DATA::random(rng))),
34750 FILE_TRANSFER_PROTOCOL_DATA::ID => Some(Self::FILE_TRANSFER_PROTOCOL(
34751 FILE_TRANSFER_PROTOCOL_DATA::random(rng),
34752 )),
34753 FLIGHT_INFORMATION_DATA::ID => Some(Self::FLIGHT_INFORMATION(
34754 FLIGHT_INFORMATION_DATA::random(rng),
34755 )),
34756 FOLLOW_TARGET_DATA::ID => Some(Self::FOLLOW_TARGET(FOLLOW_TARGET_DATA::random(rng))),
34757 FUEL_STATUS_DATA::ID => Some(Self::FUEL_STATUS(FUEL_STATUS_DATA::random(rng))),
34758 GENERATOR_STATUS_DATA::ID => {
34759 Some(Self::GENERATOR_STATUS(GENERATOR_STATUS_DATA::random(rng)))
34760 }
34761 GIMBAL_DEVICE_ATTITUDE_STATUS_DATA::ID => Some(Self::GIMBAL_DEVICE_ATTITUDE_STATUS(
34762 GIMBAL_DEVICE_ATTITUDE_STATUS_DATA::random(rng),
34763 )),
34764 GIMBAL_DEVICE_INFORMATION_DATA::ID => Some(Self::GIMBAL_DEVICE_INFORMATION(
34765 GIMBAL_DEVICE_INFORMATION_DATA::random(rng),
34766 )),
34767 GIMBAL_DEVICE_SET_ATTITUDE_DATA::ID => Some(Self::GIMBAL_DEVICE_SET_ATTITUDE(
34768 GIMBAL_DEVICE_SET_ATTITUDE_DATA::random(rng),
34769 )),
34770 GIMBAL_MANAGER_INFORMATION_DATA::ID => Some(Self::GIMBAL_MANAGER_INFORMATION(
34771 GIMBAL_MANAGER_INFORMATION_DATA::random(rng),
34772 )),
34773 GIMBAL_MANAGER_SET_ATTITUDE_DATA::ID => Some(Self::GIMBAL_MANAGER_SET_ATTITUDE(
34774 GIMBAL_MANAGER_SET_ATTITUDE_DATA::random(rng),
34775 )),
34776 GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA::ID => {
34777 Some(Self::GIMBAL_MANAGER_SET_MANUAL_CONTROL(
34778 GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA::random(rng),
34779 ))
34780 }
34781 GIMBAL_MANAGER_SET_PITCHYAW_DATA::ID => Some(Self::GIMBAL_MANAGER_SET_PITCHYAW(
34782 GIMBAL_MANAGER_SET_PITCHYAW_DATA::random(rng),
34783 )),
34784 GIMBAL_MANAGER_STATUS_DATA::ID => Some(Self::GIMBAL_MANAGER_STATUS(
34785 GIMBAL_MANAGER_STATUS_DATA::random(rng),
34786 )),
34787 GLOBAL_POSITION_INT_DATA::ID => Some(Self::GLOBAL_POSITION_INT(
34788 GLOBAL_POSITION_INT_DATA::random(rng),
34789 )),
34790 GLOBAL_POSITION_INT_COV_DATA::ID => Some(Self::GLOBAL_POSITION_INT_COV(
34791 GLOBAL_POSITION_INT_COV_DATA::random(rng),
34792 )),
34793 GLOBAL_VISION_POSITION_ESTIMATE_DATA::ID => {
34794 Some(Self::GLOBAL_VISION_POSITION_ESTIMATE(
34795 GLOBAL_VISION_POSITION_ESTIMATE_DATA::random(rng),
34796 ))
34797 }
34798 GPS2_RAW_DATA::ID => Some(Self::GPS2_RAW(GPS2_RAW_DATA::random(rng))),
34799 GPS2_RTK_DATA::ID => Some(Self::GPS2_RTK(GPS2_RTK_DATA::random(rng))),
34800 GPS_GLOBAL_ORIGIN_DATA::ID => {
34801 Some(Self::GPS_GLOBAL_ORIGIN(GPS_GLOBAL_ORIGIN_DATA::random(rng)))
34802 }
34803 GPS_INJECT_DATA_DATA::ID => {
34804 Some(Self::GPS_INJECT_DATA(GPS_INJECT_DATA_DATA::random(rng)))
34805 }
34806 GPS_INPUT_DATA::ID => Some(Self::GPS_INPUT(GPS_INPUT_DATA::random(rng))),
34807 GPS_RAW_INT_DATA::ID => Some(Self::GPS_RAW_INT(GPS_RAW_INT_DATA::random(rng))),
34808 GPS_RTCM_DATA_DATA::ID => Some(Self::GPS_RTCM_DATA(GPS_RTCM_DATA_DATA::random(rng))),
34809 GPS_RTK_DATA::ID => Some(Self::GPS_RTK(GPS_RTK_DATA::random(rng))),
34810 GPS_STATUS_DATA::ID => Some(Self::GPS_STATUS(GPS_STATUS_DATA::random(rng))),
34811 HEARTBEAT_DATA::ID => Some(Self::HEARTBEAT(HEARTBEAT_DATA::random(rng))),
34812 HIGHRES_IMU_DATA::ID => Some(Self::HIGHRES_IMU(HIGHRES_IMU_DATA::random(rng))),
34813 HIGH_LATENCY_DATA::ID => Some(Self::HIGH_LATENCY(HIGH_LATENCY_DATA::random(rng))),
34814 HIGH_LATENCY2_DATA::ID => Some(Self::HIGH_LATENCY2(HIGH_LATENCY2_DATA::random(rng))),
34815 HIL_ACTUATOR_CONTROLS_DATA::ID => Some(Self::HIL_ACTUATOR_CONTROLS(
34816 HIL_ACTUATOR_CONTROLS_DATA::random(rng),
34817 )),
34818 HIL_CONTROLS_DATA::ID => Some(Self::HIL_CONTROLS(HIL_CONTROLS_DATA::random(rng))),
34819 HIL_GPS_DATA::ID => Some(Self::HIL_GPS(HIL_GPS_DATA::random(rng))),
34820 HIL_OPTICAL_FLOW_DATA::ID => {
34821 Some(Self::HIL_OPTICAL_FLOW(HIL_OPTICAL_FLOW_DATA::random(rng)))
34822 }
34823 HIL_RC_INPUTS_RAW_DATA::ID => {
34824 Some(Self::HIL_RC_INPUTS_RAW(HIL_RC_INPUTS_RAW_DATA::random(rng)))
34825 }
34826 HIL_SENSOR_DATA::ID => Some(Self::HIL_SENSOR(HIL_SENSOR_DATA::random(rng))),
34827 HIL_STATE_DATA::ID => Some(Self::HIL_STATE(HIL_STATE_DATA::random(rng))),
34828 HIL_STATE_QUATERNION_DATA::ID => Some(Self::HIL_STATE_QUATERNION(
34829 HIL_STATE_QUATERNION_DATA::random(rng),
34830 )),
34831 HOME_POSITION_DATA::ID => Some(Self::HOME_POSITION(HOME_POSITION_DATA::random(rng))),
34832 HYGROMETER_SENSOR_DATA::ID => {
34833 Some(Self::HYGROMETER_SENSOR(HYGROMETER_SENSOR_DATA::random(rng)))
34834 }
34835 ILLUMINATOR_STATUS_DATA::ID => Some(Self::ILLUMINATOR_STATUS(
34836 ILLUMINATOR_STATUS_DATA::random(rng),
34837 )),
34838 ISBD_LINK_STATUS_DATA::ID => {
34839 Some(Self::ISBD_LINK_STATUS(ISBD_LINK_STATUS_DATA::random(rng)))
34840 }
34841 LANDING_TARGET_DATA::ID => Some(Self::LANDING_TARGET(LANDING_TARGET_DATA::random(rng))),
34842 LINK_NODE_STATUS_DATA::ID => {
34843 Some(Self::LINK_NODE_STATUS(LINK_NODE_STATUS_DATA::random(rng)))
34844 }
34845 LOCAL_POSITION_NED_DATA::ID => Some(Self::LOCAL_POSITION_NED(
34846 LOCAL_POSITION_NED_DATA::random(rng),
34847 )),
34848 LOCAL_POSITION_NED_COV_DATA::ID => Some(Self::LOCAL_POSITION_NED_COV(
34849 LOCAL_POSITION_NED_COV_DATA::random(rng),
34850 )),
34851 LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA::ID => {
34852 Some(Self::LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET(
34853 LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA::random(rng),
34854 ))
34855 }
34856 LOGGING_ACK_DATA::ID => Some(Self::LOGGING_ACK(LOGGING_ACK_DATA::random(rng))),
34857 LOGGING_DATA_DATA::ID => Some(Self::LOGGING_DATA(LOGGING_DATA_DATA::random(rng))),
34858 LOGGING_DATA_ACKED_DATA::ID => Some(Self::LOGGING_DATA_ACKED(
34859 LOGGING_DATA_ACKED_DATA::random(rng),
34860 )),
34861 LOG_DATA_DATA::ID => Some(Self::LOG_DATA(LOG_DATA_DATA::random(rng))),
34862 LOG_ENTRY_DATA::ID => Some(Self::LOG_ENTRY(LOG_ENTRY_DATA::random(rng))),
34863 LOG_ERASE_DATA::ID => Some(Self::LOG_ERASE(LOG_ERASE_DATA::random(rng))),
34864 LOG_REQUEST_DATA_DATA::ID => {
34865 Some(Self::LOG_REQUEST_DATA(LOG_REQUEST_DATA_DATA::random(rng)))
34866 }
34867 LOG_REQUEST_END_DATA::ID => {
34868 Some(Self::LOG_REQUEST_END(LOG_REQUEST_END_DATA::random(rng)))
34869 }
34870 LOG_REQUEST_LIST_DATA::ID => {
34871 Some(Self::LOG_REQUEST_LIST(LOG_REQUEST_LIST_DATA::random(rng)))
34872 }
34873 MAG_CAL_REPORT_DATA::ID => Some(Self::MAG_CAL_REPORT(MAG_CAL_REPORT_DATA::random(rng))),
34874 MANUAL_CONTROL_DATA::ID => Some(Self::MANUAL_CONTROL(MANUAL_CONTROL_DATA::random(rng))),
34875 MANUAL_SETPOINT_DATA::ID => {
34876 Some(Self::MANUAL_SETPOINT(MANUAL_SETPOINT_DATA::random(rng)))
34877 }
34878 MEMORY_VECT_DATA::ID => Some(Self::MEMORY_VECT(MEMORY_VECT_DATA::random(rng))),
34879 MESSAGE_INTERVAL_DATA::ID => {
34880 Some(Self::MESSAGE_INTERVAL(MESSAGE_INTERVAL_DATA::random(rng)))
34881 }
34882 MISSION_ACK_DATA::ID => Some(Self::MISSION_ACK(MISSION_ACK_DATA::random(rng))),
34883 MISSION_CLEAR_ALL_DATA::ID => {
34884 Some(Self::MISSION_CLEAR_ALL(MISSION_CLEAR_ALL_DATA::random(rng)))
34885 }
34886 MISSION_COUNT_DATA::ID => Some(Self::MISSION_COUNT(MISSION_COUNT_DATA::random(rng))),
34887 MISSION_CURRENT_DATA::ID => {
34888 Some(Self::MISSION_CURRENT(MISSION_CURRENT_DATA::random(rng)))
34889 }
34890 MISSION_ITEM_DATA::ID => Some(Self::MISSION_ITEM(MISSION_ITEM_DATA::random(rng))),
34891 MISSION_ITEM_INT_DATA::ID => {
34892 Some(Self::MISSION_ITEM_INT(MISSION_ITEM_INT_DATA::random(rng)))
34893 }
34894 MISSION_ITEM_REACHED_DATA::ID => Some(Self::MISSION_ITEM_REACHED(
34895 MISSION_ITEM_REACHED_DATA::random(rng),
34896 )),
34897 MISSION_REQUEST_DATA::ID => {
34898 Some(Self::MISSION_REQUEST(MISSION_REQUEST_DATA::random(rng)))
34899 }
34900 MISSION_REQUEST_INT_DATA::ID => Some(Self::MISSION_REQUEST_INT(
34901 MISSION_REQUEST_INT_DATA::random(rng),
34902 )),
34903 MISSION_REQUEST_LIST_DATA::ID => Some(Self::MISSION_REQUEST_LIST(
34904 MISSION_REQUEST_LIST_DATA::random(rng),
34905 )),
34906 MISSION_REQUEST_PARTIAL_LIST_DATA::ID => Some(Self::MISSION_REQUEST_PARTIAL_LIST(
34907 MISSION_REQUEST_PARTIAL_LIST_DATA::random(rng),
34908 )),
34909 MISSION_SET_CURRENT_DATA::ID => Some(Self::MISSION_SET_CURRENT(
34910 MISSION_SET_CURRENT_DATA::random(rng),
34911 )),
34912 MISSION_WRITE_PARTIAL_LIST_DATA::ID => Some(Self::MISSION_WRITE_PARTIAL_LIST(
34913 MISSION_WRITE_PARTIAL_LIST_DATA::random(rng),
34914 )),
34915 MOUNT_ORIENTATION_DATA::ID => {
34916 Some(Self::MOUNT_ORIENTATION(MOUNT_ORIENTATION_DATA::random(rng)))
34917 }
34918 NAMED_VALUE_FLOAT_DATA::ID => {
34919 Some(Self::NAMED_VALUE_FLOAT(NAMED_VALUE_FLOAT_DATA::random(rng)))
34920 }
34921 NAMED_VALUE_INT_DATA::ID => {
34922 Some(Self::NAMED_VALUE_INT(NAMED_VALUE_INT_DATA::random(rng)))
34923 }
34924 NAV_CONTROLLER_OUTPUT_DATA::ID => Some(Self::NAV_CONTROLLER_OUTPUT(
34925 NAV_CONTROLLER_OUTPUT_DATA::random(rng),
34926 )),
34927 OBSTACLE_DISTANCE_DATA::ID => {
34928 Some(Self::OBSTACLE_DISTANCE(OBSTACLE_DISTANCE_DATA::random(rng)))
34929 }
34930 ODOMETRY_DATA::ID => Some(Self::ODOMETRY(ODOMETRY_DATA::random(rng))),
34931 ONBOARD_COMPUTER_STATUS_DATA::ID => Some(Self::ONBOARD_COMPUTER_STATUS(
34932 ONBOARD_COMPUTER_STATUS_DATA::random(rng),
34933 )),
34934 OPEN_DRONE_ID_ARM_STATUS_DATA::ID => Some(Self::OPEN_DRONE_ID_ARM_STATUS(
34935 OPEN_DRONE_ID_ARM_STATUS_DATA::random(rng),
34936 )),
34937 OPEN_DRONE_ID_AUTHENTICATION_DATA::ID => Some(Self::OPEN_DRONE_ID_AUTHENTICATION(
34938 OPEN_DRONE_ID_AUTHENTICATION_DATA::random(rng),
34939 )),
34940 OPEN_DRONE_ID_BASIC_ID_DATA::ID => Some(Self::OPEN_DRONE_ID_BASIC_ID(
34941 OPEN_DRONE_ID_BASIC_ID_DATA::random(rng),
34942 )),
34943 OPEN_DRONE_ID_LOCATION_DATA::ID => Some(Self::OPEN_DRONE_ID_LOCATION(
34944 OPEN_DRONE_ID_LOCATION_DATA::random(rng),
34945 )),
34946 OPEN_DRONE_ID_MESSAGE_PACK_DATA::ID => Some(Self::OPEN_DRONE_ID_MESSAGE_PACK(
34947 OPEN_DRONE_ID_MESSAGE_PACK_DATA::random(rng),
34948 )),
34949 OPEN_DRONE_ID_OPERATOR_ID_DATA::ID => Some(Self::OPEN_DRONE_ID_OPERATOR_ID(
34950 OPEN_DRONE_ID_OPERATOR_ID_DATA::random(rng),
34951 )),
34952 OPEN_DRONE_ID_SELF_ID_DATA::ID => Some(Self::OPEN_DRONE_ID_SELF_ID(
34953 OPEN_DRONE_ID_SELF_ID_DATA::random(rng),
34954 )),
34955 OPEN_DRONE_ID_SYSTEM_DATA::ID => Some(Self::OPEN_DRONE_ID_SYSTEM(
34956 OPEN_DRONE_ID_SYSTEM_DATA::random(rng),
34957 )),
34958 OPEN_DRONE_ID_SYSTEM_UPDATE_DATA::ID => Some(Self::OPEN_DRONE_ID_SYSTEM_UPDATE(
34959 OPEN_DRONE_ID_SYSTEM_UPDATE_DATA::random(rng),
34960 )),
34961 OPTICAL_FLOW_DATA::ID => Some(Self::OPTICAL_FLOW(OPTICAL_FLOW_DATA::random(rng))),
34962 OPTICAL_FLOW_RAD_DATA::ID => {
34963 Some(Self::OPTICAL_FLOW_RAD(OPTICAL_FLOW_RAD_DATA::random(rng)))
34964 }
34965 ORBIT_EXECUTION_STATUS_DATA::ID => Some(Self::ORBIT_EXECUTION_STATUS(
34966 ORBIT_EXECUTION_STATUS_DATA::random(rng),
34967 )),
34968 PARAM_EXT_ACK_DATA::ID => Some(Self::PARAM_EXT_ACK(PARAM_EXT_ACK_DATA::random(rng))),
34969 PARAM_EXT_REQUEST_LIST_DATA::ID => Some(Self::PARAM_EXT_REQUEST_LIST(
34970 PARAM_EXT_REQUEST_LIST_DATA::random(rng),
34971 )),
34972 PARAM_EXT_REQUEST_READ_DATA::ID => Some(Self::PARAM_EXT_REQUEST_READ(
34973 PARAM_EXT_REQUEST_READ_DATA::random(rng),
34974 )),
34975 PARAM_EXT_SET_DATA::ID => Some(Self::PARAM_EXT_SET(PARAM_EXT_SET_DATA::random(rng))),
34976 PARAM_EXT_VALUE_DATA::ID => {
34977 Some(Self::PARAM_EXT_VALUE(PARAM_EXT_VALUE_DATA::random(rng)))
34978 }
34979 PARAM_MAP_RC_DATA::ID => Some(Self::PARAM_MAP_RC(PARAM_MAP_RC_DATA::random(rng))),
34980 PARAM_REQUEST_LIST_DATA::ID => Some(Self::PARAM_REQUEST_LIST(
34981 PARAM_REQUEST_LIST_DATA::random(rng),
34982 )),
34983 PARAM_REQUEST_READ_DATA::ID => Some(Self::PARAM_REQUEST_READ(
34984 PARAM_REQUEST_READ_DATA::random(rng),
34985 )),
34986 PARAM_SET_DATA::ID => Some(Self::PARAM_SET(PARAM_SET_DATA::random(rng))),
34987 PARAM_VALUE_DATA::ID => Some(Self::PARAM_VALUE(PARAM_VALUE_DATA::random(rng))),
34988 PING_DATA::ID => Some(Self::PING(PING_DATA::random(rng))),
34989 PLAY_TUNE_DATA::ID => Some(Self::PLAY_TUNE(PLAY_TUNE_DATA::random(rng))),
34990 PLAY_TUNE_V2_DATA::ID => Some(Self::PLAY_TUNE_V2(PLAY_TUNE_V2_DATA::random(rng))),
34991 POSITION_TARGET_GLOBAL_INT_DATA::ID => Some(Self::POSITION_TARGET_GLOBAL_INT(
34992 POSITION_TARGET_GLOBAL_INT_DATA::random(rng),
34993 )),
34994 POSITION_TARGET_LOCAL_NED_DATA::ID => Some(Self::POSITION_TARGET_LOCAL_NED(
34995 POSITION_TARGET_LOCAL_NED_DATA::random(rng),
34996 )),
34997 POWER_STATUS_DATA::ID => Some(Self::POWER_STATUS(POWER_STATUS_DATA::random(rng))),
34998 PROTOCOL_VERSION_DATA::ID => {
34999 Some(Self::PROTOCOL_VERSION(PROTOCOL_VERSION_DATA::random(rng)))
35000 }
35001 RADIO_STATUS_DATA::ID => Some(Self::RADIO_STATUS(RADIO_STATUS_DATA::random(rng))),
35002 RAW_IMU_DATA::ID => Some(Self::RAW_IMU(RAW_IMU_DATA::random(rng))),
35003 RAW_PRESSURE_DATA::ID => Some(Self::RAW_PRESSURE(RAW_PRESSURE_DATA::random(rng))),
35004 RAW_RPM_DATA::ID => Some(Self::RAW_RPM(RAW_RPM_DATA::random(rng))),
35005 RC_CHANNELS_DATA::ID => Some(Self::RC_CHANNELS(RC_CHANNELS_DATA::random(rng))),
35006 RC_CHANNELS_OVERRIDE_DATA::ID => Some(Self::RC_CHANNELS_OVERRIDE(
35007 RC_CHANNELS_OVERRIDE_DATA::random(rng),
35008 )),
35009 RC_CHANNELS_RAW_DATA::ID => {
35010 Some(Self::RC_CHANNELS_RAW(RC_CHANNELS_RAW_DATA::random(rng)))
35011 }
35012 RC_CHANNELS_SCALED_DATA::ID => Some(Self::RC_CHANNELS_SCALED(
35013 RC_CHANNELS_SCALED_DATA::random(rng),
35014 )),
35015 REQUEST_DATA_STREAM_DATA::ID => Some(Self::REQUEST_DATA_STREAM(
35016 REQUEST_DATA_STREAM_DATA::random(rng),
35017 )),
35018 REQUEST_EVENT_DATA::ID => Some(Self::REQUEST_EVENT(REQUEST_EVENT_DATA::random(rng))),
35019 RESOURCE_REQUEST_DATA::ID => {
35020 Some(Self::RESOURCE_REQUEST(RESOURCE_REQUEST_DATA::random(rng)))
35021 }
35022 RESPONSE_EVENT_ERROR_DATA::ID => Some(Self::RESPONSE_EVENT_ERROR(
35023 RESPONSE_EVENT_ERROR_DATA::random(rng),
35024 )),
35025 SAFETY_ALLOWED_AREA_DATA::ID => Some(Self::SAFETY_ALLOWED_AREA(
35026 SAFETY_ALLOWED_AREA_DATA::random(rng),
35027 )),
35028 SAFETY_SET_ALLOWED_AREA_DATA::ID => Some(Self::SAFETY_SET_ALLOWED_AREA(
35029 SAFETY_SET_ALLOWED_AREA_DATA::random(rng),
35030 )),
35031 SCALED_IMU_DATA::ID => Some(Self::SCALED_IMU(SCALED_IMU_DATA::random(rng))),
35032 SCALED_IMU2_DATA::ID => Some(Self::SCALED_IMU2(SCALED_IMU2_DATA::random(rng))),
35033 SCALED_IMU3_DATA::ID => Some(Self::SCALED_IMU3(SCALED_IMU3_DATA::random(rng))),
35034 SCALED_PRESSURE_DATA::ID => {
35035 Some(Self::SCALED_PRESSURE(SCALED_PRESSURE_DATA::random(rng)))
35036 }
35037 SCALED_PRESSURE2_DATA::ID => {
35038 Some(Self::SCALED_PRESSURE2(SCALED_PRESSURE2_DATA::random(rng)))
35039 }
35040 SCALED_PRESSURE3_DATA::ID => {
35041 Some(Self::SCALED_PRESSURE3(SCALED_PRESSURE3_DATA::random(rng)))
35042 }
35043 SERIAL_CONTROL_DATA::ID => Some(Self::SERIAL_CONTROL(SERIAL_CONTROL_DATA::random(rng))),
35044 SERVO_OUTPUT_RAW_DATA::ID => {
35045 Some(Self::SERVO_OUTPUT_RAW(SERVO_OUTPUT_RAW_DATA::random(rng)))
35046 }
35047 SETUP_SIGNING_DATA::ID => Some(Self::SETUP_SIGNING(SETUP_SIGNING_DATA::random(rng))),
35048 SET_ACTUATOR_CONTROL_TARGET_DATA::ID => Some(Self::SET_ACTUATOR_CONTROL_TARGET(
35049 SET_ACTUATOR_CONTROL_TARGET_DATA::random(rng),
35050 )),
35051 SET_ATTITUDE_TARGET_DATA::ID => Some(Self::SET_ATTITUDE_TARGET(
35052 SET_ATTITUDE_TARGET_DATA::random(rng),
35053 )),
35054 SET_GPS_GLOBAL_ORIGIN_DATA::ID => Some(Self::SET_GPS_GLOBAL_ORIGIN(
35055 SET_GPS_GLOBAL_ORIGIN_DATA::random(rng),
35056 )),
35057 SET_HOME_POSITION_DATA::ID => {
35058 Some(Self::SET_HOME_POSITION(SET_HOME_POSITION_DATA::random(rng)))
35059 }
35060 SET_MODE_DATA::ID => Some(Self::SET_MODE(SET_MODE_DATA::random(rng))),
35061 SET_POSITION_TARGET_GLOBAL_INT_DATA::ID => Some(Self::SET_POSITION_TARGET_GLOBAL_INT(
35062 SET_POSITION_TARGET_GLOBAL_INT_DATA::random(rng),
35063 )),
35064 SET_POSITION_TARGET_LOCAL_NED_DATA::ID => Some(Self::SET_POSITION_TARGET_LOCAL_NED(
35065 SET_POSITION_TARGET_LOCAL_NED_DATA::random(rng),
35066 )),
35067 SIM_STATE_DATA::ID => Some(Self::SIM_STATE(SIM_STATE_DATA::random(rng))),
35068 SMART_BATTERY_INFO_DATA::ID => Some(Self::SMART_BATTERY_INFO(
35069 SMART_BATTERY_INFO_DATA::random(rng),
35070 )),
35071 STATUSTEXT_DATA::ID => Some(Self::STATUSTEXT(STATUSTEXT_DATA::random(rng))),
35072 STORAGE_INFORMATION_DATA::ID => Some(Self::STORAGE_INFORMATION(
35073 STORAGE_INFORMATION_DATA::random(rng),
35074 )),
35075 SUPPORTED_TUNES_DATA::ID => {
35076 Some(Self::SUPPORTED_TUNES(SUPPORTED_TUNES_DATA::random(rng)))
35077 }
35078 SYSTEM_TIME_DATA::ID => Some(Self::SYSTEM_TIME(SYSTEM_TIME_DATA::random(rng))),
35079 SYS_STATUS_DATA::ID => Some(Self::SYS_STATUS(SYS_STATUS_DATA::random(rng))),
35080 TERRAIN_CHECK_DATA::ID => Some(Self::TERRAIN_CHECK(TERRAIN_CHECK_DATA::random(rng))),
35081 TERRAIN_DATA_DATA::ID => Some(Self::TERRAIN_DATA(TERRAIN_DATA_DATA::random(rng))),
35082 TERRAIN_REPORT_DATA::ID => Some(Self::TERRAIN_REPORT(TERRAIN_REPORT_DATA::random(rng))),
35083 TERRAIN_REQUEST_DATA::ID => {
35084 Some(Self::TERRAIN_REQUEST(TERRAIN_REQUEST_DATA::random(rng)))
35085 }
35086 TIMESYNC_DATA::ID => Some(Self::TIMESYNC(TIMESYNC_DATA::random(rng))),
35087 TIME_ESTIMATE_TO_TARGET_DATA::ID => Some(Self::TIME_ESTIMATE_TO_TARGET(
35088 TIME_ESTIMATE_TO_TARGET_DATA::random(rng),
35089 )),
35090 TRAJECTORY_REPRESENTATION_BEZIER_DATA::ID => {
35091 Some(Self::TRAJECTORY_REPRESENTATION_BEZIER(
35092 TRAJECTORY_REPRESENTATION_BEZIER_DATA::random(rng),
35093 ))
35094 }
35095 TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA::ID => {
35096 Some(Self::TRAJECTORY_REPRESENTATION_WAYPOINTS(
35097 TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA::random(rng),
35098 ))
35099 }
35100 TUNNEL_DATA::ID => Some(Self::TUNNEL(TUNNEL_DATA::random(rng))),
35101 UAVCAN_NODE_INFO_DATA::ID => {
35102 Some(Self::UAVCAN_NODE_INFO(UAVCAN_NODE_INFO_DATA::random(rng)))
35103 }
35104 UAVCAN_NODE_STATUS_DATA::ID => Some(Self::UAVCAN_NODE_STATUS(
35105 UAVCAN_NODE_STATUS_DATA::random(rng),
35106 )),
35107 UTM_GLOBAL_POSITION_DATA::ID => Some(Self::UTM_GLOBAL_POSITION(
35108 UTM_GLOBAL_POSITION_DATA::random(rng),
35109 )),
35110 V2_EXTENSION_DATA::ID => Some(Self::V2_EXTENSION(V2_EXTENSION_DATA::random(rng))),
35111 VFR_HUD_DATA::ID => Some(Self::VFR_HUD(VFR_HUD_DATA::random(rng))),
35112 VIBRATION_DATA::ID => Some(Self::VIBRATION(VIBRATION_DATA::random(rng))),
35113 VICON_POSITION_ESTIMATE_DATA::ID => Some(Self::VICON_POSITION_ESTIMATE(
35114 VICON_POSITION_ESTIMATE_DATA::random(rng),
35115 )),
35116 VIDEO_STREAM_INFORMATION_DATA::ID => Some(Self::VIDEO_STREAM_INFORMATION(
35117 VIDEO_STREAM_INFORMATION_DATA::random(rng),
35118 )),
35119 VIDEO_STREAM_STATUS_DATA::ID => Some(Self::VIDEO_STREAM_STATUS(
35120 VIDEO_STREAM_STATUS_DATA::random(rng),
35121 )),
35122 VISION_POSITION_ESTIMATE_DATA::ID => Some(Self::VISION_POSITION_ESTIMATE(
35123 VISION_POSITION_ESTIMATE_DATA::random(rng),
35124 )),
35125 VISION_SPEED_ESTIMATE_DATA::ID => Some(Self::VISION_SPEED_ESTIMATE(
35126 VISION_SPEED_ESTIMATE_DATA::random(rng),
35127 )),
35128 WHEEL_DISTANCE_DATA::ID => Some(Self::WHEEL_DISTANCE(WHEEL_DISTANCE_DATA::random(rng))),
35129 WIFI_CONFIG_AP_DATA::ID => Some(Self::WIFI_CONFIG_AP(WIFI_CONFIG_AP_DATA::random(rng))),
35130 WINCH_STATUS_DATA::ID => Some(Self::WINCH_STATUS(WINCH_STATUS_DATA::random(rng))),
35131 WIND_COV_DATA::ID => Some(Self::WIND_COV(WIND_COV_DATA::random(rng))),
35132 _ => None,
35133 }
35134 }
35135 fn ser(&self, version: MavlinkVersion, bytes: &mut [u8]) -> usize {
35136 match self {
35137 Self::ACTUATOR_CONTROL_TARGET(body) => body.ser(version, bytes),
35138 Self::ACTUATOR_OUTPUT_STATUS(body) => body.ser(version, bytes),
35139 Self::ADSB_VEHICLE(body) => body.ser(version, bytes),
35140 Self::AIS_VESSEL(body) => body.ser(version, bytes),
35141 Self::ALTITUDE(body) => body.ser(version, bytes),
35142 Self::ATTITUDE(body) => body.ser(version, bytes),
35143 Self::ATTITUDE_QUATERNION(body) => body.ser(version, bytes),
35144 Self::ATTITUDE_QUATERNION_COV(body) => body.ser(version, bytes),
35145 Self::ATTITUDE_TARGET(body) => body.ser(version, bytes),
35146 Self::ATT_POS_MOCAP(body) => body.ser(version, bytes),
35147 Self::AUTH_KEY(body) => body.ser(version, bytes),
35148 Self::AUTOPILOT_STATE_FOR_GIMBAL_DEVICE(body) => body.ser(version, bytes),
35149 Self::AUTOPILOT_VERSION(body) => body.ser(version, bytes),
35150 Self::AVAILABLE_MODES(body) => body.ser(version, bytes),
35151 Self::AVAILABLE_MODES_MONITOR(body) => body.ser(version, bytes),
35152 Self::AVSS_DRONE_IMU(body) => body.ser(version, bytes),
35153 Self::AVSS_DRONE_OPERATION_MODE(body) => body.ser(version, bytes),
35154 Self::AVSS_DRONE_POSITION(body) => body.ser(version, bytes),
35155 Self::AVSS_PRS_SYS_STATUS(body) => body.ser(version, bytes),
35156 Self::BATTERY_INFO(body) => body.ser(version, bytes),
35157 Self::BATTERY_STATUS(body) => body.ser(version, bytes),
35158 Self::BUTTON_CHANGE(body) => body.ser(version, bytes),
35159 Self::CAMERA_CAPTURE_STATUS(body) => body.ser(version, bytes),
35160 Self::CAMERA_FOV_STATUS(body) => body.ser(version, bytes),
35161 Self::CAMERA_IMAGE_CAPTURED(body) => body.ser(version, bytes),
35162 Self::CAMERA_INFORMATION(body) => body.ser(version, bytes),
35163 Self::CAMERA_SETTINGS(body) => body.ser(version, bytes),
35164 Self::CAMERA_THERMAL_RANGE(body) => body.ser(version, bytes),
35165 Self::CAMERA_TRACKING_GEO_STATUS(body) => body.ser(version, bytes),
35166 Self::CAMERA_TRACKING_IMAGE_STATUS(body) => body.ser(version, bytes),
35167 Self::CAMERA_TRIGGER(body) => body.ser(version, bytes),
35168 Self::CANFD_FRAME(body) => body.ser(version, bytes),
35169 Self::CAN_FILTER_MODIFY(body) => body.ser(version, bytes),
35170 Self::CAN_FRAME(body) => body.ser(version, bytes),
35171 Self::CELLULAR_CONFIG(body) => body.ser(version, bytes),
35172 Self::CELLULAR_STATUS(body) => body.ser(version, bytes),
35173 Self::CHANGE_OPERATOR_CONTROL(body) => body.ser(version, bytes),
35174 Self::CHANGE_OPERATOR_CONTROL_ACK(body) => body.ser(version, bytes),
35175 Self::COLLISION(body) => body.ser(version, bytes),
35176 Self::COMMAND_ACK(body) => body.ser(version, bytes),
35177 Self::COMMAND_CANCEL(body) => body.ser(version, bytes),
35178 Self::COMMAND_INT(body) => body.ser(version, bytes),
35179 Self::COMMAND_LONG(body) => body.ser(version, bytes),
35180 Self::COMPONENT_INFORMATION(body) => body.ser(version, bytes),
35181 Self::COMPONENT_INFORMATION_BASIC(body) => body.ser(version, bytes),
35182 Self::COMPONENT_METADATA(body) => body.ser(version, bytes),
35183 Self::CONTROL_SYSTEM_STATE(body) => body.ser(version, bytes),
35184 Self::CURRENT_EVENT_SEQUENCE(body) => body.ser(version, bytes),
35185 Self::CURRENT_MODE(body) => body.ser(version, bytes),
35186 Self::DATA_STREAM(body) => body.ser(version, bytes),
35187 Self::DATA_TRANSMISSION_HANDSHAKE(body) => body.ser(version, bytes),
35188 Self::DEBUG(body) => body.ser(version, bytes),
35189 Self::DEBUG_FLOAT_ARRAY(body) => body.ser(version, bytes),
35190 Self::DEBUG_VECT(body) => body.ser(version, bytes),
35191 Self::DISTANCE_SENSOR(body) => body.ser(version, bytes),
35192 Self::EFI_STATUS(body) => body.ser(version, bytes),
35193 Self::ENCAPSULATED_DATA(body) => body.ser(version, bytes),
35194 Self::ESC_INFO(body) => body.ser(version, bytes),
35195 Self::ESC_STATUS(body) => body.ser(version, bytes),
35196 Self::ESTIMATOR_STATUS(body) => body.ser(version, bytes),
35197 Self::EVENT(body) => body.ser(version, bytes),
35198 Self::EXTENDED_SYS_STATE(body) => body.ser(version, bytes),
35199 Self::FENCE_STATUS(body) => body.ser(version, bytes),
35200 Self::FILE_TRANSFER_PROTOCOL(body) => body.ser(version, bytes),
35201 Self::FLIGHT_INFORMATION(body) => body.ser(version, bytes),
35202 Self::FOLLOW_TARGET(body) => body.ser(version, bytes),
35203 Self::FUEL_STATUS(body) => body.ser(version, bytes),
35204 Self::GENERATOR_STATUS(body) => body.ser(version, bytes),
35205 Self::GIMBAL_DEVICE_ATTITUDE_STATUS(body) => body.ser(version, bytes),
35206 Self::GIMBAL_DEVICE_INFORMATION(body) => body.ser(version, bytes),
35207 Self::GIMBAL_DEVICE_SET_ATTITUDE(body) => body.ser(version, bytes),
35208 Self::GIMBAL_MANAGER_INFORMATION(body) => body.ser(version, bytes),
35209 Self::GIMBAL_MANAGER_SET_ATTITUDE(body) => body.ser(version, bytes),
35210 Self::GIMBAL_MANAGER_SET_MANUAL_CONTROL(body) => body.ser(version, bytes),
35211 Self::GIMBAL_MANAGER_SET_PITCHYAW(body) => body.ser(version, bytes),
35212 Self::GIMBAL_MANAGER_STATUS(body) => body.ser(version, bytes),
35213 Self::GLOBAL_POSITION_INT(body) => body.ser(version, bytes),
35214 Self::GLOBAL_POSITION_INT_COV(body) => body.ser(version, bytes),
35215 Self::GLOBAL_VISION_POSITION_ESTIMATE(body) => body.ser(version, bytes),
35216 Self::GPS2_RAW(body) => body.ser(version, bytes),
35217 Self::GPS2_RTK(body) => body.ser(version, bytes),
35218 Self::GPS_GLOBAL_ORIGIN(body) => body.ser(version, bytes),
35219 Self::GPS_INJECT_DATA(body) => body.ser(version, bytes),
35220 Self::GPS_INPUT(body) => body.ser(version, bytes),
35221 Self::GPS_RAW_INT(body) => body.ser(version, bytes),
35222 Self::GPS_RTCM_DATA(body) => body.ser(version, bytes),
35223 Self::GPS_RTK(body) => body.ser(version, bytes),
35224 Self::GPS_STATUS(body) => body.ser(version, bytes),
35225 Self::HEARTBEAT(body) => body.ser(version, bytes),
35226 Self::HIGHRES_IMU(body) => body.ser(version, bytes),
35227 Self::HIGH_LATENCY(body) => body.ser(version, bytes),
35228 Self::HIGH_LATENCY2(body) => body.ser(version, bytes),
35229 Self::HIL_ACTUATOR_CONTROLS(body) => body.ser(version, bytes),
35230 Self::HIL_CONTROLS(body) => body.ser(version, bytes),
35231 Self::HIL_GPS(body) => body.ser(version, bytes),
35232 Self::HIL_OPTICAL_FLOW(body) => body.ser(version, bytes),
35233 Self::HIL_RC_INPUTS_RAW(body) => body.ser(version, bytes),
35234 Self::HIL_SENSOR(body) => body.ser(version, bytes),
35235 Self::HIL_STATE(body) => body.ser(version, bytes),
35236 Self::HIL_STATE_QUATERNION(body) => body.ser(version, bytes),
35237 Self::HOME_POSITION(body) => body.ser(version, bytes),
35238 Self::HYGROMETER_SENSOR(body) => body.ser(version, bytes),
35239 Self::ILLUMINATOR_STATUS(body) => body.ser(version, bytes),
35240 Self::ISBD_LINK_STATUS(body) => body.ser(version, bytes),
35241 Self::LANDING_TARGET(body) => body.ser(version, bytes),
35242 Self::LINK_NODE_STATUS(body) => body.ser(version, bytes),
35243 Self::LOCAL_POSITION_NED(body) => body.ser(version, bytes),
35244 Self::LOCAL_POSITION_NED_COV(body) => body.ser(version, bytes),
35245 Self::LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET(body) => body.ser(version, bytes),
35246 Self::LOGGING_ACK(body) => body.ser(version, bytes),
35247 Self::LOGGING_DATA(body) => body.ser(version, bytes),
35248 Self::LOGGING_DATA_ACKED(body) => body.ser(version, bytes),
35249 Self::LOG_DATA(body) => body.ser(version, bytes),
35250 Self::LOG_ENTRY(body) => body.ser(version, bytes),
35251 Self::LOG_ERASE(body) => body.ser(version, bytes),
35252 Self::LOG_REQUEST_DATA(body) => body.ser(version, bytes),
35253 Self::LOG_REQUEST_END(body) => body.ser(version, bytes),
35254 Self::LOG_REQUEST_LIST(body) => body.ser(version, bytes),
35255 Self::MAG_CAL_REPORT(body) => body.ser(version, bytes),
35256 Self::MANUAL_CONTROL(body) => body.ser(version, bytes),
35257 Self::MANUAL_SETPOINT(body) => body.ser(version, bytes),
35258 Self::MEMORY_VECT(body) => body.ser(version, bytes),
35259 Self::MESSAGE_INTERVAL(body) => body.ser(version, bytes),
35260 Self::MISSION_ACK(body) => body.ser(version, bytes),
35261 Self::MISSION_CLEAR_ALL(body) => body.ser(version, bytes),
35262 Self::MISSION_COUNT(body) => body.ser(version, bytes),
35263 Self::MISSION_CURRENT(body) => body.ser(version, bytes),
35264 Self::MISSION_ITEM(body) => body.ser(version, bytes),
35265 Self::MISSION_ITEM_INT(body) => body.ser(version, bytes),
35266 Self::MISSION_ITEM_REACHED(body) => body.ser(version, bytes),
35267 Self::MISSION_REQUEST(body) => body.ser(version, bytes),
35268 Self::MISSION_REQUEST_INT(body) => body.ser(version, bytes),
35269 Self::MISSION_REQUEST_LIST(body) => body.ser(version, bytes),
35270 Self::MISSION_REQUEST_PARTIAL_LIST(body) => body.ser(version, bytes),
35271 Self::MISSION_SET_CURRENT(body) => body.ser(version, bytes),
35272 Self::MISSION_WRITE_PARTIAL_LIST(body) => body.ser(version, bytes),
35273 Self::MOUNT_ORIENTATION(body) => body.ser(version, bytes),
35274 Self::NAMED_VALUE_FLOAT(body) => body.ser(version, bytes),
35275 Self::NAMED_VALUE_INT(body) => body.ser(version, bytes),
35276 Self::NAV_CONTROLLER_OUTPUT(body) => body.ser(version, bytes),
35277 Self::OBSTACLE_DISTANCE(body) => body.ser(version, bytes),
35278 Self::ODOMETRY(body) => body.ser(version, bytes),
35279 Self::ONBOARD_COMPUTER_STATUS(body) => body.ser(version, bytes),
35280 Self::OPEN_DRONE_ID_ARM_STATUS(body) => body.ser(version, bytes),
35281 Self::OPEN_DRONE_ID_AUTHENTICATION(body) => body.ser(version, bytes),
35282 Self::OPEN_DRONE_ID_BASIC_ID(body) => body.ser(version, bytes),
35283 Self::OPEN_DRONE_ID_LOCATION(body) => body.ser(version, bytes),
35284 Self::OPEN_DRONE_ID_MESSAGE_PACK(body) => body.ser(version, bytes),
35285 Self::OPEN_DRONE_ID_OPERATOR_ID(body) => body.ser(version, bytes),
35286 Self::OPEN_DRONE_ID_SELF_ID(body) => body.ser(version, bytes),
35287 Self::OPEN_DRONE_ID_SYSTEM(body) => body.ser(version, bytes),
35288 Self::OPEN_DRONE_ID_SYSTEM_UPDATE(body) => body.ser(version, bytes),
35289 Self::OPTICAL_FLOW(body) => body.ser(version, bytes),
35290 Self::OPTICAL_FLOW_RAD(body) => body.ser(version, bytes),
35291 Self::ORBIT_EXECUTION_STATUS(body) => body.ser(version, bytes),
35292 Self::PARAM_EXT_ACK(body) => body.ser(version, bytes),
35293 Self::PARAM_EXT_REQUEST_LIST(body) => body.ser(version, bytes),
35294 Self::PARAM_EXT_REQUEST_READ(body) => body.ser(version, bytes),
35295 Self::PARAM_EXT_SET(body) => body.ser(version, bytes),
35296 Self::PARAM_EXT_VALUE(body) => body.ser(version, bytes),
35297 Self::PARAM_MAP_RC(body) => body.ser(version, bytes),
35298 Self::PARAM_REQUEST_LIST(body) => body.ser(version, bytes),
35299 Self::PARAM_REQUEST_READ(body) => body.ser(version, bytes),
35300 Self::PARAM_SET(body) => body.ser(version, bytes),
35301 Self::PARAM_VALUE(body) => body.ser(version, bytes),
35302 Self::PING(body) => body.ser(version, bytes),
35303 Self::PLAY_TUNE(body) => body.ser(version, bytes),
35304 Self::PLAY_TUNE_V2(body) => body.ser(version, bytes),
35305 Self::POSITION_TARGET_GLOBAL_INT(body) => body.ser(version, bytes),
35306 Self::POSITION_TARGET_LOCAL_NED(body) => body.ser(version, bytes),
35307 Self::POWER_STATUS(body) => body.ser(version, bytes),
35308 Self::PROTOCOL_VERSION(body) => body.ser(version, bytes),
35309 Self::RADIO_STATUS(body) => body.ser(version, bytes),
35310 Self::RAW_IMU(body) => body.ser(version, bytes),
35311 Self::RAW_PRESSURE(body) => body.ser(version, bytes),
35312 Self::RAW_RPM(body) => body.ser(version, bytes),
35313 Self::RC_CHANNELS(body) => body.ser(version, bytes),
35314 Self::RC_CHANNELS_OVERRIDE(body) => body.ser(version, bytes),
35315 Self::RC_CHANNELS_RAW(body) => body.ser(version, bytes),
35316 Self::RC_CHANNELS_SCALED(body) => body.ser(version, bytes),
35317 Self::REQUEST_DATA_STREAM(body) => body.ser(version, bytes),
35318 Self::REQUEST_EVENT(body) => body.ser(version, bytes),
35319 Self::RESOURCE_REQUEST(body) => body.ser(version, bytes),
35320 Self::RESPONSE_EVENT_ERROR(body) => body.ser(version, bytes),
35321 Self::SAFETY_ALLOWED_AREA(body) => body.ser(version, bytes),
35322 Self::SAFETY_SET_ALLOWED_AREA(body) => body.ser(version, bytes),
35323 Self::SCALED_IMU(body) => body.ser(version, bytes),
35324 Self::SCALED_IMU2(body) => body.ser(version, bytes),
35325 Self::SCALED_IMU3(body) => body.ser(version, bytes),
35326 Self::SCALED_PRESSURE(body) => body.ser(version, bytes),
35327 Self::SCALED_PRESSURE2(body) => body.ser(version, bytes),
35328 Self::SCALED_PRESSURE3(body) => body.ser(version, bytes),
35329 Self::SERIAL_CONTROL(body) => body.ser(version, bytes),
35330 Self::SERVO_OUTPUT_RAW(body) => body.ser(version, bytes),
35331 Self::SETUP_SIGNING(body) => body.ser(version, bytes),
35332 Self::SET_ACTUATOR_CONTROL_TARGET(body) => body.ser(version, bytes),
35333 Self::SET_ATTITUDE_TARGET(body) => body.ser(version, bytes),
35334 Self::SET_GPS_GLOBAL_ORIGIN(body) => body.ser(version, bytes),
35335 Self::SET_HOME_POSITION(body) => body.ser(version, bytes),
35336 Self::SET_MODE(body) => body.ser(version, bytes),
35337 Self::SET_POSITION_TARGET_GLOBAL_INT(body) => body.ser(version, bytes),
35338 Self::SET_POSITION_TARGET_LOCAL_NED(body) => body.ser(version, bytes),
35339 Self::SIM_STATE(body) => body.ser(version, bytes),
35340 Self::SMART_BATTERY_INFO(body) => body.ser(version, bytes),
35341 Self::STATUSTEXT(body) => body.ser(version, bytes),
35342 Self::STORAGE_INFORMATION(body) => body.ser(version, bytes),
35343 Self::SUPPORTED_TUNES(body) => body.ser(version, bytes),
35344 Self::SYSTEM_TIME(body) => body.ser(version, bytes),
35345 Self::SYS_STATUS(body) => body.ser(version, bytes),
35346 Self::TERRAIN_CHECK(body) => body.ser(version, bytes),
35347 Self::TERRAIN_DATA(body) => body.ser(version, bytes),
35348 Self::TERRAIN_REPORT(body) => body.ser(version, bytes),
35349 Self::TERRAIN_REQUEST(body) => body.ser(version, bytes),
35350 Self::TIMESYNC(body) => body.ser(version, bytes),
35351 Self::TIME_ESTIMATE_TO_TARGET(body) => body.ser(version, bytes),
35352 Self::TRAJECTORY_REPRESENTATION_BEZIER(body) => body.ser(version, bytes),
35353 Self::TRAJECTORY_REPRESENTATION_WAYPOINTS(body) => body.ser(version, bytes),
35354 Self::TUNNEL(body) => body.ser(version, bytes),
35355 Self::UAVCAN_NODE_INFO(body) => body.ser(version, bytes),
35356 Self::UAVCAN_NODE_STATUS(body) => body.ser(version, bytes),
35357 Self::UTM_GLOBAL_POSITION(body) => body.ser(version, bytes),
35358 Self::V2_EXTENSION(body) => body.ser(version, bytes),
35359 Self::VFR_HUD(body) => body.ser(version, bytes),
35360 Self::VIBRATION(body) => body.ser(version, bytes),
35361 Self::VICON_POSITION_ESTIMATE(body) => body.ser(version, bytes),
35362 Self::VIDEO_STREAM_INFORMATION(body) => body.ser(version, bytes),
35363 Self::VIDEO_STREAM_STATUS(body) => body.ser(version, bytes),
35364 Self::VISION_POSITION_ESTIMATE(body) => body.ser(version, bytes),
35365 Self::VISION_SPEED_ESTIMATE(body) => body.ser(version, bytes),
35366 Self::WHEEL_DISTANCE(body) => body.ser(version, bytes),
35367 Self::WIFI_CONFIG_AP(body) => body.ser(version, bytes),
35368 Self::WINCH_STATUS(body) => body.ser(version, bytes),
35369 Self::WIND_COV(body) => body.ser(version, bytes),
35370 }
35371 }
35372 fn extra_crc(id: u32) -> u8 {
35373 match id {
35374 ACTUATOR_CONTROL_TARGET_DATA::ID => ACTUATOR_CONTROL_TARGET_DATA::EXTRA_CRC,
35375 ACTUATOR_OUTPUT_STATUS_DATA::ID => ACTUATOR_OUTPUT_STATUS_DATA::EXTRA_CRC,
35376 ADSB_VEHICLE_DATA::ID => ADSB_VEHICLE_DATA::EXTRA_CRC,
35377 AIS_VESSEL_DATA::ID => AIS_VESSEL_DATA::EXTRA_CRC,
35378 ALTITUDE_DATA::ID => ALTITUDE_DATA::EXTRA_CRC,
35379 ATTITUDE_DATA::ID => ATTITUDE_DATA::EXTRA_CRC,
35380 ATTITUDE_QUATERNION_DATA::ID => ATTITUDE_QUATERNION_DATA::EXTRA_CRC,
35381 ATTITUDE_QUATERNION_COV_DATA::ID => ATTITUDE_QUATERNION_COV_DATA::EXTRA_CRC,
35382 ATTITUDE_TARGET_DATA::ID => ATTITUDE_TARGET_DATA::EXTRA_CRC,
35383 ATT_POS_MOCAP_DATA::ID => ATT_POS_MOCAP_DATA::EXTRA_CRC,
35384 AUTH_KEY_DATA::ID => AUTH_KEY_DATA::EXTRA_CRC,
35385 AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA::ID => {
35386 AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_DATA::EXTRA_CRC
35387 }
35388 AUTOPILOT_VERSION_DATA::ID => AUTOPILOT_VERSION_DATA::EXTRA_CRC,
35389 AVAILABLE_MODES_DATA::ID => AVAILABLE_MODES_DATA::EXTRA_CRC,
35390 AVAILABLE_MODES_MONITOR_DATA::ID => AVAILABLE_MODES_MONITOR_DATA::EXTRA_CRC,
35391 AVSS_DRONE_IMU_DATA::ID => AVSS_DRONE_IMU_DATA::EXTRA_CRC,
35392 AVSS_DRONE_OPERATION_MODE_DATA::ID => AVSS_DRONE_OPERATION_MODE_DATA::EXTRA_CRC,
35393 AVSS_DRONE_POSITION_DATA::ID => AVSS_DRONE_POSITION_DATA::EXTRA_CRC,
35394 AVSS_PRS_SYS_STATUS_DATA::ID => AVSS_PRS_SYS_STATUS_DATA::EXTRA_CRC,
35395 BATTERY_INFO_DATA::ID => BATTERY_INFO_DATA::EXTRA_CRC,
35396 BATTERY_STATUS_DATA::ID => BATTERY_STATUS_DATA::EXTRA_CRC,
35397 BUTTON_CHANGE_DATA::ID => BUTTON_CHANGE_DATA::EXTRA_CRC,
35398 CAMERA_CAPTURE_STATUS_DATA::ID => CAMERA_CAPTURE_STATUS_DATA::EXTRA_CRC,
35399 CAMERA_FOV_STATUS_DATA::ID => CAMERA_FOV_STATUS_DATA::EXTRA_CRC,
35400 CAMERA_IMAGE_CAPTURED_DATA::ID => CAMERA_IMAGE_CAPTURED_DATA::EXTRA_CRC,
35401 CAMERA_INFORMATION_DATA::ID => CAMERA_INFORMATION_DATA::EXTRA_CRC,
35402 CAMERA_SETTINGS_DATA::ID => CAMERA_SETTINGS_DATA::EXTRA_CRC,
35403 CAMERA_THERMAL_RANGE_DATA::ID => CAMERA_THERMAL_RANGE_DATA::EXTRA_CRC,
35404 CAMERA_TRACKING_GEO_STATUS_DATA::ID => CAMERA_TRACKING_GEO_STATUS_DATA::EXTRA_CRC,
35405 CAMERA_TRACKING_IMAGE_STATUS_DATA::ID => CAMERA_TRACKING_IMAGE_STATUS_DATA::EXTRA_CRC,
35406 CAMERA_TRIGGER_DATA::ID => CAMERA_TRIGGER_DATA::EXTRA_CRC,
35407 CANFD_FRAME_DATA::ID => CANFD_FRAME_DATA::EXTRA_CRC,
35408 CAN_FILTER_MODIFY_DATA::ID => CAN_FILTER_MODIFY_DATA::EXTRA_CRC,
35409 CAN_FRAME_DATA::ID => CAN_FRAME_DATA::EXTRA_CRC,
35410 CELLULAR_CONFIG_DATA::ID => CELLULAR_CONFIG_DATA::EXTRA_CRC,
35411 CELLULAR_STATUS_DATA::ID => CELLULAR_STATUS_DATA::EXTRA_CRC,
35412 CHANGE_OPERATOR_CONTROL_DATA::ID => CHANGE_OPERATOR_CONTROL_DATA::EXTRA_CRC,
35413 CHANGE_OPERATOR_CONTROL_ACK_DATA::ID => CHANGE_OPERATOR_CONTROL_ACK_DATA::EXTRA_CRC,
35414 COLLISION_DATA::ID => COLLISION_DATA::EXTRA_CRC,
35415 COMMAND_ACK_DATA::ID => COMMAND_ACK_DATA::EXTRA_CRC,
35416 COMMAND_CANCEL_DATA::ID => COMMAND_CANCEL_DATA::EXTRA_CRC,
35417 COMMAND_INT_DATA::ID => COMMAND_INT_DATA::EXTRA_CRC,
35418 COMMAND_LONG_DATA::ID => COMMAND_LONG_DATA::EXTRA_CRC,
35419 COMPONENT_INFORMATION_DATA::ID => COMPONENT_INFORMATION_DATA::EXTRA_CRC,
35420 COMPONENT_INFORMATION_BASIC_DATA::ID => COMPONENT_INFORMATION_BASIC_DATA::EXTRA_CRC,
35421 COMPONENT_METADATA_DATA::ID => COMPONENT_METADATA_DATA::EXTRA_CRC,
35422 CONTROL_SYSTEM_STATE_DATA::ID => CONTROL_SYSTEM_STATE_DATA::EXTRA_CRC,
35423 CURRENT_EVENT_SEQUENCE_DATA::ID => CURRENT_EVENT_SEQUENCE_DATA::EXTRA_CRC,
35424 CURRENT_MODE_DATA::ID => CURRENT_MODE_DATA::EXTRA_CRC,
35425 DATA_STREAM_DATA::ID => DATA_STREAM_DATA::EXTRA_CRC,
35426 DATA_TRANSMISSION_HANDSHAKE_DATA::ID => DATA_TRANSMISSION_HANDSHAKE_DATA::EXTRA_CRC,
35427 DEBUG_DATA::ID => DEBUG_DATA::EXTRA_CRC,
35428 DEBUG_FLOAT_ARRAY_DATA::ID => DEBUG_FLOAT_ARRAY_DATA::EXTRA_CRC,
35429 DEBUG_VECT_DATA::ID => DEBUG_VECT_DATA::EXTRA_CRC,
35430 DISTANCE_SENSOR_DATA::ID => DISTANCE_SENSOR_DATA::EXTRA_CRC,
35431 EFI_STATUS_DATA::ID => EFI_STATUS_DATA::EXTRA_CRC,
35432 ENCAPSULATED_DATA_DATA::ID => ENCAPSULATED_DATA_DATA::EXTRA_CRC,
35433 ESC_INFO_DATA::ID => ESC_INFO_DATA::EXTRA_CRC,
35434 ESC_STATUS_DATA::ID => ESC_STATUS_DATA::EXTRA_CRC,
35435 ESTIMATOR_STATUS_DATA::ID => ESTIMATOR_STATUS_DATA::EXTRA_CRC,
35436 EVENT_DATA::ID => EVENT_DATA::EXTRA_CRC,
35437 EXTENDED_SYS_STATE_DATA::ID => EXTENDED_SYS_STATE_DATA::EXTRA_CRC,
35438 FENCE_STATUS_DATA::ID => FENCE_STATUS_DATA::EXTRA_CRC,
35439 FILE_TRANSFER_PROTOCOL_DATA::ID => FILE_TRANSFER_PROTOCOL_DATA::EXTRA_CRC,
35440 FLIGHT_INFORMATION_DATA::ID => FLIGHT_INFORMATION_DATA::EXTRA_CRC,
35441 FOLLOW_TARGET_DATA::ID => FOLLOW_TARGET_DATA::EXTRA_CRC,
35442 FUEL_STATUS_DATA::ID => FUEL_STATUS_DATA::EXTRA_CRC,
35443 GENERATOR_STATUS_DATA::ID => GENERATOR_STATUS_DATA::EXTRA_CRC,
35444 GIMBAL_DEVICE_ATTITUDE_STATUS_DATA::ID => GIMBAL_DEVICE_ATTITUDE_STATUS_DATA::EXTRA_CRC,
35445 GIMBAL_DEVICE_INFORMATION_DATA::ID => GIMBAL_DEVICE_INFORMATION_DATA::EXTRA_CRC,
35446 GIMBAL_DEVICE_SET_ATTITUDE_DATA::ID => GIMBAL_DEVICE_SET_ATTITUDE_DATA::EXTRA_CRC,
35447 GIMBAL_MANAGER_INFORMATION_DATA::ID => GIMBAL_MANAGER_INFORMATION_DATA::EXTRA_CRC,
35448 GIMBAL_MANAGER_SET_ATTITUDE_DATA::ID => GIMBAL_MANAGER_SET_ATTITUDE_DATA::EXTRA_CRC,
35449 GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA::ID => {
35450 GIMBAL_MANAGER_SET_MANUAL_CONTROL_DATA::EXTRA_CRC
35451 }
35452 GIMBAL_MANAGER_SET_PITCHYAW_DATA::ID => GIMBAL_MANAGER_SET_PITCHYAW_DATA::EXTRA_CRC,
35453 GIMBAL_MANAGER_STATUS_DATA::ID => GIMBAL_MANAGER_STATUS_DATA::EXTRA_CRC,
35454 GLOBAL_POSITION_INT_DATA::ID => GLOBAL_POSITION_INT_DATA::EXTRA_CRC,
35455 GLOBAL_POSITION_INT_COV_DATA::ID => GLOBAL_POSITION_INT_COV_DATA::EXTRA_CRC,
35456 GLOBAL_VISION_POSITION_ESTIMATE_DATA::ID => {
35457 GLOBAL_VISION_POSITION_ESTIMATE_DATA::EXTRA_CRC
35458 }
35459 GPS2_RAW_DATA::ID => GPS2_RAW_DATA::EXTRA_CRC,
35460 GPS2_RTK_DATA::ID => GPS2_RTK_DATA::EXTRA_CRC,
35461 GPS_GLOBAL_ORIGIN_DATA::ID => GPS_GLOBAL_ORIGIN_DATA::EXTRA_CRC,
35462 GPS_INJECT_DATA_DATA::ID => GPS_INJECT_DATA_DATA::EXTRA_CRC,
35463 GPS_INPUT_DATA::ID => GPS_INPUT_DATA::EXTRA_CRC,
35464 GPS_RAW_INT_DATA::ID => GPS_RAW_INT_DATA::EXTRA_CRC,
35465 GPS_RTCM_DATA_DATA::ID => GPS_RTCM_DATA_DATA::EXTRA_CRC,
35466 GPS_RTK_DATA::ID => GPS_RTK_DATA::EXTRA_CRC,
35467 GPS_STATUS_DATA::ID => GPS_STATUS_DATA::EXTRA_CRC,
35468 HEARTBEAT_DATA::ID => HEARTBEAT_DATA::EXTRA_CRC,
35469 HIGHRES_IMU_DATA::ID => HIGHRES_IMU_DATA::EXTRA_CRC,
35470 HIGH_LATENCY_DATA::ID => HIGH_LATENCY_DATA::EXTRA_CRC,
35471 HIGH_LATENCY2_DATA::ID => HIGH_LATENCY2_DATA::EXTRA_CRC,
35472 HIL_ACTUATOR_CONTROLS_DATA::ID => HIL_ACTUATOR_CONTROLS_DATA::EXTRA_CRC,
35473 HIL_CONTROLS_DATA::ID => HIL_CONTROLS_DATA::EXTRA_CRC,
35474 HIL_GPS_DATA::ID => HIL_GPS_DATA::EXTRA_CRC,
35475 HIL_OPTICAL_FLOW_DATA::ID => HIL_OPTICAL_FLOW_DATA::EXTRA_CRC,
35476 HIL_RC_INPUTS_RAW_DATA::ID => HIL_RC_INPUTS_RAW_DATA::EXTRA_CRC,
35477 HIL_SENSOR_DATA::ID => HIL_SENSOR_DATA::EXTRA_CRC,
35478 HIL_STATE_DATA::ID => HIL_STATE_DATA::EXTRA_CRC,
35479 HIL_STATE_QUATERNION_DATA::ID => HIL_STATE_QUATERNION_DATA::EXTRA_CRC,
35480 HOME_POSITION_DATA::ID => HOME_POSITION_DATA::EXTRA_CRC,
35481 HYGROMETER_SENSOR_DATA::ID => HYGROMETER_SENSOR_DATA::EXTRA_CRC,
35482 ILLUMINATOR_STATUS_DATA::ID => ILLUMINATOR_STATUS_DATA::EXTRA_CRC,
35483 ISBD_LINK_STATUS_DATA::ID => ISBD_LINK_STATUS_DATA::EXTRA_CRC,
35484 LANDING_TARGET_DATA::ID => LANDING_TARGET_DATA::EXTRA_CRC,
35485 LINK_NODE_STATUS_DATA::ID => LINK_NODE_STATUS_DATA::EXTRA_CRC,
35486 LOCAL_POSITION_NED_DATA::ID => LOCAL_POSITION_NED_DATA::EXTRA_CRC,
35487 LOCAL_POSITION_NED_COV_DATA::ID => LOCAL_POSITION_NED_COV_DATA::EXTRA_CRC,
35488 LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA::ID => {
35489 LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_DATA::EXTRA_CRC
35490 }
35491 LOGGING_ACK_DATA::ID => LOGGING_ACK_DATA::EXTRA_CRC,
35492 LOGGING_DATA_DATA::ID => LOGGING_DATA_DATA::EXTRA_CRC,
35493 LOGGING_DATA_ACKED_DATA::ID => LOGGING_DATA_ACKED_DATA::EXTRA_CRC,
35494 LOG_DATA_DATA::ID => LOG_DATA_DATA::EXTRA_CRC,
35495 LOG_ENTRY_DATA::ID => LOG_ENTRY_DATA::EXTRA_CRC,
35496 LOG_ERASE_DATA::ID => LOG_ERASE_DATA::EXTRA_CRC,
35497 LOG_REQUEST_DATA_DATA::ID => LOG_REQUEST_DATA_DATA::EXTRA_CRC,
35498 LOG_REQUEST_END_DATA::ID => LOG_REQUEST_END_DATA::EXTRA_CRC,
35499 LOG_REQUEST_LIST_DATA::ID => LOG_REQUEST_LIST_DATA::EXTRA_CRC,
35500 MAG_CAL_REPORT_DATA::ID => MAG_CAL_REPORT_DATA::EXTRA_CRC,
35501 MANUAL_CONTROL_DATA::ID => MANUAL_CONTROL_DATA::EXTRA_CRC,
35502 MANUAL_SETPOINT_DATA::ID => MANUAL_SETPOINT_DATA::EXTRA_CRC,
35503 MEMORY_VECT_DATA::ID => MEMORY_VECT_DATA::EXTRA_CRC,
35504 MESSAGE_INTERVAL_DATA::ID => MESSAGE_INTERVAL_DATA::EXTRA_CRC,
35505 MISSION_ACK_DATA::ID => MISSION_ACK_DATA::EXTRA_CRC,
35506 MISSION_CLEAR_ALL_DATA::ID => MISSION_CLEAR_ALL_DATA::EXTRA_CRC,
35507 MISSION_COUNT_DATA::ID => MISSION_COUNT_DATA::EXTRA_CRC,
35508 MISSION_CURRENT_DATA::ID => MISSION_CURRENT_DATA::EXTRA_CRC,
35509 MISSION_ITEM_DATA::ID => MISSION_ITEM_DATA::EXTRA_CRC,
35510 MISSION_ITEM_INT_DATA::ID => MISSION_ITEM_INT_DATA::EXTRA_CRC,
35511 MISSION_ITEM_REACHED_DATA::ID => MISSION_ITEM_REACHED_DATA::EXTRA_CRC,
35512 MISSION_REQUEST_DATA::ID => MISSION_REQUEST_DATA::EXTRA_CRC,
35513 MISSION_REQUEST_INT_DATA::ID => MISSION_REQUEST_INT_DATA::EXTRA_CRC,
35514 MISSION_REQUEST_LIST_DATA::ID => MISSION_REQUEST_LIST_DATA::EXTRA_CRC,
35515 MISSION_REQUEST_PARTIAL_LIST_DATA::ID => MISSION_REQUEST_PARTIAL_LIST_DATA::EXTRA_CRC,
35516 MISSION_SET_CURRENT_DATA::ID => MISSION_SET_CURRENT_DATA::EXTRA_CRC,
35517 MISSION_WRITE_PARTIAL_LIST_DATA::ID => MISSION_WRITE_PARTIAL_LIST_DATA::EXTRA_CRC,
35518 MOUNT_ORIENTATION_DATA::ID => MOUNT_ORIENTATION_DATA::EXTRA_CRC,
35519 NAMED_VALUE_FLOAT_DATA::ID => NAMED_VALUE_FLOAT_DATA::EXTRA_CRC,
35520 NAMED_VALUE_INT_DATA::ID => NAMED_VALUE_INT_DATA::EXTRA_CRC,
35521 NAV_CONTROLLER_OUTPUT_DATA::ID => NAV_CONTROLLER_OUTPUT_DATA::EXTRA_CRC,
35522 OBSTACLE_DISTANCE_DATA::ID => OBSTACLE_DISTANCE_DATA::EXTRA_CRC,
35523 ODOMETRY_DATA::ID => ODOMETRY_DATA::EXTRA_CRC,
35524 ONBOARD_COMPUTER_STATUS_DATA::ID => ONBOARD_COMPUTER_STATUS_DATA::EXTRA_CRC,
35525 OPEN_DRONE_ID_ARM_STATUS_DATA::ID => OPEN_DRONE_ID_ARM_STATUS_DATA::EXTRA_CRC,
35526 OPEN_DRONE_ID_AUTHENTICATION_DATA::ID => OPEN_DRONE_ID_AUTHENTICATION_DATA::EXTRA_CRC,
35527 OPEN_DRONE_ID_BASIC_ID_DATA::ID => OPEN_DRONE_ID_BASIC_ID_DATA::EXTRA_CRC,
35528 OPEN_DRONE_ID_LOCATION_DATA::ID => OPEN_DRONE_ID_LOCATION_DATA::EXTRA_CRC,
35529 OPEN_DRONE_ID_MESSAGE_PACK_DATA::ID => OPEN_DRONE_ID_MESSAGE_PACK_DATA::EXTRA_CRC,
35530 OPEN_DRONE_ID_OPERATOR_ID_DATA::ID => OPEN_DRONE_ID_OPERATOR_ID_DATA::EXTRA_CRC,
35531 OPEN_DRONE_ID_SELF_ID_DATA::ID => OPEN_DRONE_ID_SELF_ID_DATA::EXTRA_CRC,
35532 OPEN_DRONE_ID_SYSTEM_DATA::ID => OPEN_DRONE_ID_SYSTEM_DATA::EXTRA_CRC,
35533 OPEN_DRONE_ID_SYSTEM_UPDATE_DATA::ID => OPEN_DRONE_ID_SYSTEM_UPDATE_DATA::EXTRA_CRC,
35534 OPTICAL_FLOW_DATA::ID => OPTICAL_FLOW_DATA::EXTRA_CRC,
35535 OPTICAL_FLOW_RAD_DATA::ID => OPTICAL_FLOW_RAD_DATA::EXTRA_CRC,
35536 ORBIT_EXECUTION_STATUS_DATA::ID => ORBIT_EXECUTION_STATUS_DATA::EXTRA_CRC,
35537 PARAM_EXT_ACK_DATA::ID => PARAM_EXT_ACK_DATA::EXTRA_CRC,
35538 PARAM_EXT_REQUEST_LIST_DATA::ID => PARAM_EXT_REQUEST_LIST_DATA::EXTRA_CRC,
35539 PARAM_EXT_REQUEST_READ_DATA::ID => PARAM_EXT_REQUEST_READ_DATA::EXTRA_CRC,
35540 PARAM_EXT_SET_DATA::ID => PARAM_EXT_SET_DATA::EXTRA_CRC,
35541 PARAM_EXT_VALUE_DATA::ID => PARAM_EXT_VALUE_DATA::EXTRA_CRC,
35542 PARAM_MAP_RC_DATA::ID => PARAM_MAP_RC_DATA::EXTRA_CRC,
35543 PARAM_REQUEST_LIST_DATA::ID => PARAM_REQUEST_LIST_DATA::EXTRA_CRC,
35544 PARAM_REQUEST_READ_DATA::ID => PARAM_REQUEST_READ_DATA::EXTRA_CRC,
35545 PARAM_SET_DATA::ID => PARAM_SET_DATA::EXTRA_CRC,
35546 PARAM_VALUE_DATA::ID => PARAM_VALUE_DATA::EXTRA_CRC,
35547 PING_DATA::ID => PING_DATA::EXTRA_CRC,
35548 PLAY_TUNE_DATA::ID => PLAY_TUNE_DATA::EXTRA_CRC,
35549 PLAY_TUNE_V2_DATA::ID => PLAY_TUNE_V2_DATA::EXTRA_CRC,
35550 POSITION_TARGET_GLOBAL_INT_DATA::ID => POSITION_TARGET_GLOBAL_INT_DATA::EXTRA_CRC,
35551 POSITION_TARGET_LOCAL_NED_DATA::ID => POSITION_TARGET_LOCAL_NED_DATA::EXTRA_CRC,
35552 POWER_STATUS_DATA::ID => POWER_STATUS_DATA::EXTRA_CRC,
35553 PROTOCOL_VERSION_DATA::ID => PROTOCOL_VERSION_DATA::EXTRA_CRC,
35554 RADIO_STATUS_DATA::ID => RADIO_STATUS_DATA::EXTRA_CRC,
35555 RAW_IMU_DATA::ID => RAW_IMU_DATA::EXTRA_CRC,
35556 RAW_PRESSURE_DATA::ID => RAW_PRESSURE_DATA::EXTRA_CRC,
35557 RAW_RPM_DATA::ID => RAW_RPM_DATA::EXTRA_CRC,
35558 RC_CHANNELS_DATA::ID => RC_CHANNELS_DATA::EXTRA_CRC,
35559 RC_CHANNELS_OVERRIDE_DATA::ID => RC_CHANNELS_OVERRIDE_DATA::EXTRA_CRC,
35560 RC_CHANNELS_RAW_DATA::ID => RC_CHANNELS_RAW_DATA::EXTRA_CRC,
35561 RC_CHANNELS_SCALED_DATA::ID => RC_CHANNELS_SCALED_DATA::EXTRA_CRC,
35562 REQUEST_DATA_STREAM_DATA::ID => REQUEST_DATA_STREAM_DATA::EXTRA_CRC,
35563 REQUEST_EVENT_DATA::ID => REQUEST_EVENT_DATA::EXTRA_CRC,
35564 RESOURCE_REQUEST_DATA::ID => RESOURCE_REQUEST_DATA::EXTRA_CRC,
35565 RESPONSE_EVENT_ERROR_DATA::ID => RESPONSE_EVENT_ERROR_DATA::EXTRA_CRC,
35566 SAFETY_ALLOWED_AREA_DATA::ID => SAFETY_ALLOWED_AREA_DATA::EXTRA_CRC,
35567 SAFETY_SET_ALLOWED_AREA_DATA::ID => SAFETY_SET_ALLOWED_AREA_DATA::EXTRA_CRC,
35568 SCALED_IMU_DATA::ID => SCALED_IMU_DATA::EXTRA_CRC,
35569 SCALED_IMU2_DATA::ID => SCALED_IMU2_DATA::EXTRA_CRC,
35570 SCALED_IMU3_DATA::ID => SCALED_IMU3_DATA::EXTRA_CRC,
35571 SCALED_PRESSURE_DATA::ID => SCALED_PRESSURE_DATA::EXTRA_CRC,
35572 SCALED_PRESSURE2_DATA::ID => SCALED_PRESSURE2_DATA::EXTRA_CRC,
35573 SCALED_PRESSURE3_DATA::ID => SCALED_PRESSURE3_DATA::EXTRA_CRC,
35574 SERIAL_CONTROL_DATA::ID => SERIAL_CONTROL_DATA::EXTRA_CRC,
35575 SERVO_OUTPUT_RAW_DATA::ID => SERVO_OUTPUT_RAW_DATA::EXTRA_CRC,
35576 SETUP_SIGNING_DATA::ID => SETUP_SIGNING_DATA::EXTRA_CRC,
35577 SET_ACTUATOR_CONTROL_TARGET_DATA::ID => SET_ACTUATOR_CONTROL_TARGET_DATA::EXTRA_CRC,
35578 SET_ATTITUDE_TARGET_DATA::ID => SET_ATTITUDE_TARGET_DATA::EXTRA_CRC,
35579 SET_GPS_GLOBAL_ORIGIN_DATA::ID => SET_GPS_GLOBAL_ORIGIN_DATA::EXTRA_CRC,
35580 SET_HOME_POSITION_DATA::ID => SET_HOME_POSITION_DATA::EXTRA_CRC,
35581 SET_MODE_DATA::ID => SET_MODE_DATA::EXTRA_CRC,
35582 SET_POSITION_TARGET_GLOBAL_INT_DATA::ID => {
35583 SET_POSITION_TARGET_GLOBAL_INT_DATA::EXTRA_CRC
35584 }
35585 SET_POSITION_TARGET_LOCAL_NED_DATA::ID => SET_POSITION_TARGET_LOCAL_NED_DATA::EXTRA_CRC,
35586 SIM_STATE_DATA::ID => SIM_STATE_DATA::EXTRA_CRC,
35587 SMART_BATTERY_INFO_DATA::ID => SMART_BATTERY_INFO_DATA::EXTRA_CRC,
35588 STATUSTEXT_DATA::ID => STATUSTEXT_DATA::EXTRA_CRC,
35589 STORAGE_INFORMATION_DATA::ID => STORAGE_INFORMATION_DATA::EXTRA_CRC,
35590 SUPPORTED_TUNES_DATA::ID => SUPPORTED_TUNES_DATA::EXTRA_CRC,
35591 SYSTEM_TIME_DATA::ID => SYSTEM_TIME_DATA::EXTRA_CRC,
35592 SYS_STATUS_DATA::ID => SYS_STATUS_DATA::EXTRA_CRC,
35593 TERRAIN_CHECK_DATA::ID => TERRAIN_CHECK_DATA::EXTRA_CRC,
35594 TERRAIN_DATA_DATA::ID => TERRAIN_DATA_DATA::EXTRA_CRC,
35595 TERRAIN_REPORT_DATA::ID => TERRAIN_REPORT_DATA::EXTRA_CRC,
35596 TERRAIN_REQUEST_DATA::ID => TERRAIN_REQUEST_DATA::EXTRA_CRC,
35597 TIMESYNC_DATA::ID => TIMESYNC_DATA::EXTRA_CRC,
35598 TIME_ESTIMATE_TO_TARGET_DATA::ID => TIME_ESTIMATE_TO_TARGET_DATA::EXTRA_CRC,
35599 TRAJECTORY_REPRESENTATION_BEZIER_DATA::ID => {
35600 TRAJECTORY_REPRESENTATION_BEZIER_DATA::EXTRA_CRC
35601 }
35602 TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA::ID => {
35603 TRAJECTORY_REPRESENTATION_WAYPOINTS_DATA::EXTRA_CRC
35604 }
35605 TUNNEL_DATA::ID => TUNNEL_DATA::EXTRA_CRC,
35606 UAVCAN_NODE_INFO_DATA::ID => UAVCAN_NODE_INFO_DATA::EXTRA_CRC,
35607 UAVCAN_NODE_STATUS_DATA::ID => UAVCAN_NODE_STATUS_DATA::EXTRA_CRC,
35608 UTM_GLOBAL_POSITION_DATA::ID => UTM_GLOBAL_POSITION_DATA::EXTRA_CRC,
35609 V2_EXTENSION_DATA::ID => V2_EXTENSION_DATA::EXTRA_CRC,
35610 VFR_HUD_DATA::ID => VFR_HUD_DATA::EXTRA_CRC,
35611 VIBRATION_DATA::ID => VIBRATION_DATA::EXTRA_CRC,
35612 VICON_POSITION_ESTIMATE_DATA::ID => VICON_POSITION_ESTIMATE_DATA::EXTRA_CRC,
35613 VIDEO_STREAM_INFORMATION_DATA::ID => VIDEO_STREAM_INFORMATION_DATA::EXTRA_CRC,
35614 VIDEO_STREAM_STATUS_DATA::ID => VIDEO_STREAM_STATUS_DATA::EXTRA_CRC,
35615 VISION_POSITION_ESTIMATE_DATA::ID => VISION_POSITION_ESTIMATE_DATA::EXTRA_CRC,
35616 VISION_SPEED_ESTIMATE_DATA::ID => VISION_SPEED_ESTIMATE_DATA::EXTRA_CRC,
35617 WHEEL_DISTANCE_DATA::ID => WHEEL_DISTANCE_DATA::EXTRA_CRC,
35618 WIFI_CONFIG_AP_DATA::ID => WIFI_CONFIG_AP_DATA::EXTRA_CRC,
35619 WINCH_STATUS_DATA::ID => WINCH_STATUS_DATA::EXTRA_CRC,
35620 WIND_COV_DATA::ID => WIND_COV_DATA::EXTRA_CRC,
35621 _ => 0,
35622 }
35623 }
35624 fn target_system_id(&self) -> Option<u8> {
35625 match self {
35626 Self::AUTOPILOT_STATE_FOR_GIMBAL_DEVICE(inner) => Some(inner.target_system),
35627 Self::CANFD_FRAME(inner) => Some(inner.target_system),
35628 Self::CAN_FILTER_MODIFY(inner) => Some(inner.target_system),
35629 Self::CAN_FRAME(inner) => Some(inner.target_system),
35630 Self::CHANGE_OPERATOR_CONTROL(inner) => Some(inner.target_system),
35631 Self::COMMAND_ACK(inner) => Some(inner.target_system),
35632 Self::COMMAND_CANCEL(inner) => Some(inner.target_system),
35633 Self::COMMAND_INT(inner) => Some(inner.target_system),
35634 Self::COMMAND_LONG(inner) => Some(inner.target_system),
35635 Self::FILE_TRANSFER_PROTOCOL(inner) => Some(inner.target_system),
35636 Self::GIMBAL_DEVICE_ATTITUDE_STATUS(inner) => Some(inner.target_system),
35637 Self::GIMBAL_DEVICE_SET_ATTITUDE(inner) => Some(inner.target_system),
35638 Self::GIMBAL_MANAGER_SET_ATTITUDE(inner) => Some(inner.target_system),
35639 Self::GIMBAL_MANAGER_SET_MANUAL_CONTROL(inner) => Some(inner.target_system),
35640 Self::GIMBAL_MANAGER_SET_PITCHYAW(inner) => Some(inner.target_system),
35641 Self::GPS_INJECT_DATA(inner) => Some(inner.target_system),
35642 Self::LOGGING_ACK(inner) => Some(inner.target_system),
35643 Self::LOGGING_DATA(inner) => Some(inner.target_system),
35644 Self::LOGGING_DATA_ACKED(inner) => Some(inner.target_system),
35645 Self::LOG_ERASE(inner) => Some(inner.target_system),
35646 Self::LOG_REQUEST_DATA(inner) => Some(inner.target_system),
35647 Self::LOG_REQUEST_END(inner) => Some(inner.target_system),
35648 Self::LOG_REQUEST_LIST(inner) => Some(inner.target_system),
35649 Self::MISSION_ACK(inner) => Some(inner.target_system),
35650 Self::MISSION_CLEAR_ALL(inner) => Some(inner.target_system),
35651 Self::MISSION_COUNT(inner) => Some(inner.target_system),
35652 Self::MISSION_ITEM(inner) => Some(inner.target_system),
35653 Self::MISSION_ITEM_INT(inner) => Some(inner.target_system),
35654 Self::MISSION_REQUEST(inner) => Some(inner.target_system),
35655 Self::MISSION_REQUEST_INT(inner) => Some(inner.target_system),
35656 Self::MISSION_REQUEST_LIST(inner) => Some(inner.target_system),
35657 Self::MISSION_REQUEST_PARTIAL_LIST(inner) => Some(inner.target_system),
35658 Self::MISSION_SET_CURRENT(inner) => Some(inner.target_system),
35659 Self::MISSION_WRITE_PARTIAL_LIST(inner) => Some(inner.target_system),
35660 Self::OPEN_DRONE_ID_AUTHENTICATION(inner) => Some(inner.target_system),
35661 Self::OPEN_DRONE_ID_BASIC_ID(inner) => Some(inner.target_system),
35662 Self::OPEN_DRONE_ID_LOCATION(inner) => Some(inner.target_system),
35663 Self::OPEN_DRONE_ID_MESSAGE_PACK(inner) => Some(inner.target_system),
35664 Self::OPEN_DRONE_ID_OPERATOR_ID(inner) => Some(inner.target_system),
35665 Self::OPEN_DRONE_ID_SELF_ID(inner) => Some(inner.target_system),
35666 Self::OPEN_DRONE_ID_SYSTEM(inner) => Some(inner.target_system),
35667 Self::OPEN_DRONE_ID_SYSTEM_UPDATE(inner) => Some(inner.target_system),
35668 Self::PARAM_EXT_REQUEST_LIST(inner) => Some(inner.target_system),
35669 Self::PARAM_EXT_REQUEST_READ(inner) => Some(inner.target_system),
35670 Self::PARAM_EXT_SET(inner) => Some(inner.target_system),
35671 Self::PARAM_MAP_RC(inner) => Some(inner.target_system),
35672 Self::PARAM_REQUEST_LIST(inner) => Some(inner.target_system),
35673 Self::PARAM_REQUEST_READ(inner) => Some(inner.target_system),
35674 Self::PARAM_SET(inner) => Some(inner.target_system),
35675 Self::PING(inner) => Some(inner.target_system),
35676 Self::PLAY_TUNE(inner) => Some(inner.target_system),
35677 Self::PLAY_TUNE_V2(inner) => Some(inner.target_system),
35678 Self::RC_CHANNELS_OVERRIDE(inner) => Some(inner.target_system),
35679 Self::REQUEST_DATA_STREAM(inner) => Some(inner.target_system),
35680 Self::REQUEST_EVENT(inner) => Some(inner.target_system),
35681 Self::RESPONSE_EVENT_ERROR(inner) => Some(inner.target_system),
35682 Self::SAFETY_SET_ALLOWED_AREA(inner) => Some(inner.target_system),
35683 Self::SERIAL_CONTROL(inner) => Some(inner.target_system),
35684 Self::SETUP_SIGNING(inner) => Some(inner.target_system),
35685 Self::SET_ACTUATOR_CONTROL_TARGET(inner) => Some(inner.target_system),
35686 Self::SET_ATTITUDE_TARGET(inner) => Some(inner.target_system),
35687 Self::SET_GPS_GLOBAL_ORIGIN(inner) => Some(inner.target_system),
35688 Self::SET_HOME_POSITION(inner) => Some(inner.target_system),
35689 Self::SET_MODE(inner) => Some(inner.target_system),
35690 Self::SET_POSITION_TARGET_GLOBAL_INT(inner) => Some(inner.target_system),
35691 Self::SET_POSITION_TARGET_LOCAL_NED(inner) => Some(inner.target_system),
35692 Self::SUPPORTED_TUNES(inner) => Some(inner.target_system),
35693 Self::TIMESYNC(inner) => Some(inner.target_system),
35694 Self::TUNNEL(inner) => Some(inner.target_system),
35695 Self::V2_EXTENSION(inner) => Some(inner.target_system),
35696 _ => None,
35697 }
35698 }
35699 fn target_component_id(&self) -> Option<u8> {
35700 match self {
35701 Self::AUTOPILOT_STATE_FOR_GIMBAL_DEVICE(inner) => Some(inner.target_component),
35702 Self::CANFD_FRAME(inner) => Some(inner.target_component),
35703 Self::CAN_FILTER_MODIFY(inner) => Some(inner.target_component),
35704 Self::CAN_FRAME(inner) => Some(inner.target_component),
35705 Self::COMMAND_ACK(inner) => Some(inner.target_component),
35706 Self::COMMAND_CANCEL(inner) => Some(inner.target_component),
35707 Self::COMMAND_INT(inner) => Some(inner.target_component),
35708 Self::COMMAND_LONG(inner) => Some(inner.target_component),
35709 Self::FILE_TRANSFER_PROTOCOL(inner) => Some(inner.target_component),
35710 Self::GIMBAL_DEVICE_ATTITUDE_STATUS(inner) => Some(inner.target_component),
35711 Self::GIMBAL_DEVICE_SET_ATTITUDE(inner) => Some(inner.target_component),
35712 Self::GIMBAL_MANAGER_SET_ATTITUDE(inner) => Some(inner.target_component),
35713 Self::GIMBAL_MANAGER_SET_MANUAL_CONTROL(inner) => Some(inner.target_component),
35714 Self::GIMBAL_MANAGER_SET_PITCHYAW(inner) => Some(inner.target_component),
35715 Self::GPS_INJECT_DATA(inner) => Some(inner.target_component),
35716 Self::LOGGING_ACK(inner) => Some(inner.target_component),
35717 Self::LOGGING_DATA(inner) => Some(inner.target_component),
35718 Self::LOGGING_DATA_ACKED(inner) => Some(inner.target_component),
35719 Self::LOG_ERASE(inner) => Some(inner.target_component),
35720 Self::LOG_REQUEST_DATA(inner) => Some(inner.target_component),
35721 Self::LOG_REQUEST_END(inner) => Some(inner.target_component),
35722 Self::LOG_REQUEST_LIST(inner) => Some(inner.target_component),
35723 Self::MISSION_ACK(inner) => Some(inner.target_component),
35724 Self::MISSION_CLEAR_ALL(inner) => Some(inner.target_component),
35725 Self::MISSION_COUNT(inner) => Some(inner.target_component),
35726 Self::MISSION_ITEM(inner) => Some(inner.target_component),
35727 Self::MISSION_ITEM_INT(inner) => Some(inner.target_component),
35728 Self::MISSION_REQUEST(inner) => Some(inner.target_component),
35729 Self::MISSION_REQUEST_INT(inner) => Some(inner.target_component),
35730 Self::MISSION_REQUEST_LIST(inner) => Some(inner.target_component),
35731 Self::MISSION_REQUEST_PARTIAL_LIST(inner) => Some(inner.target_component),
35732 Self::MISSION_SET_CURRENT(inner) => Some(inner.target_component),
35733 Self::MISSION_WRITE_PARTIAL_LIST(inner) => Some(inner.target_component),
35734 Self::OPEN_DRONE_ID_AUTHENTICATION(inner) => Some(inner.target_component),
35735 Self::OPEN_DRONE_ID_BASIC_ID(inner) => Some(inner.target_component),
35736 Self::OPEN_DRONE_ID_LOCATION(inner) => Some(inner.target_component),
35737 Self::OPEN_DRONE_ID_MESSAGE_PACK(inner) => Some(inner.target_component),
35738 Self::OPEN_DRONE_ID_OPERATOR_ID(inner) => Some(inner.target_component),
35739 Self::OPEN_DRONE_ID_SELF_ID(inner) => Some(inner.target_component),
35740 Self::OPEN_DRONE_ID_SYSTEM(inner) => Some(inner.target_component),
35741 Self::OPEN_DRONE_ID_SYSTEM_UPDATE(inner) => Some(inner.target_component),
35742 Self::PARAM_EXT_REQUEST_LIST(inner) => Some(inner.target_component),
35743 Self::PARAM_EXT_REQUEST_READ(inner) => Some(inner.target_component),
35744 Self::PARAM_EXT_SET(inner) => Some(inner.target_component),
35745 Self::PARAM_MAP_RC(inner) => Some(inner.target_component),
35746 Self::PARAM_REQUEST_LIST(inner) => Some(inner.target_component),
35747 Self::PARAM_REQUEST_READ(inner) => Some(inner.target_component),
35748 Self::PARAM_SET(inner) => Some(inner.target_component),
35749 Self::PING(inner) => Some(inner.target_component),
35750 Self::PLAY_TUNE(inner) => Some(inner.target_component),
35751 Self::PLAY_TUNE_V2(inner) => Some(inner.target_component),
35752 Self::RC_CHANNELS_OVERRIDE(inner) => Some(inner.target_component),
35753 Self::REQUEST_DATA_STREAM(inner) => Some(inner.target_component),
35754 Self::REQUEST_EVENT(inner) => Some(inner.target_component),
35755 Self::RESPONSE_EVENT_ERROR(inner) => Some(inner.target_component),
35756 Self::SAFETY_SET_ALLOWED_AREA(inner) => Some(inner.target_component),
35757 Self::SERIAL_CONTROL(inner) => Some(inner.target_component),
35758 Self::SETUP_SIGNING(inner) => Some(inner.target_component),
35759 Self::SET_ACTUATOR_CONTROL_TARGET(inner) => Some(inner.target_component),
35760 Self::SET_ATTITUDE_TARGET(inner) => Some(inner.target_component),
35761 Self::SET_POSITION_TARGET_GLOBAL_INT(inner) => Some(inner.target_component),
35762 Self::SET_POSITION_TARGET_LOCAL_NED(inner) => Some(inner.target_component),
35763 Self::SUPPORTED_TUNES(inner) => Some(inner.target_component),
35764 Self::TIMESYNC(inner) => Some(inner.target_component),
35765 Self::TUNNEL(inner) => Some(inner.target_component),
35766 Self::V2_EXTENSION(inner) => Some(inner.target_component),
35767 _ => None,
35768 }
35769 }
35770}